Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/joomla/joomla-cms into s…
Browse files Browse the repository at this point in the history
…taging

marged with joomla latest staging 3.4.3
  • Loading branch information
shamsbd71 committed Jul 3, 2015
2 parents 9d4d31d + d6f6cc4 commit ac76274
Show file tree
Hide file tree
Showing 58 changed files with 286 additions and 165 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_admin/script.php
Expand Up @@ -1292,6 +1292,9 @@ public function deleteUnexistingFiles()
'/administrator/components/com_config/models/forms/index.html',
// Joomla 3.4.2
'/libraries/composer_autoload.php',
// Joomla 3.4.3
'/libraries/classloader.php',
'/libraries/ClassLoader.php',
);

// TODO There is an issue while deleting folders using the ftp mode
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_categories/models/category.php
Expand Up @@ -323,9 +323,9 @@ protected function loadFormData()
$extension = substr($app->getUserState('com_categories.categories.filter.extension'), 4);
$filters = (array) $app->getUserState('com_categories.categories.' . $extension . '.filter');

$data->set('published', $app->input->getInt('published', (isset($filters['published']) ? $filters['published'] : null)));
$data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null)));
$data->set('published', $app->input->getInt('published', (!empty($filters['published']) ? $filters['published'] : null)));
$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))));
}

}
Expand Down
Expand Up @@ -128,6 +128,12 @@ public function execute()
$redirect = base64_decode($returnUri);
}

// Don't redirect to an external URL.
if (!JUri::isInternal($redirect))
{
$redirect = JUri::base();
}

$this->app->redirect(JRoute::_($redirect, false));

break;
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_content/models/article.php
Expand Up @@ -423,10 +423,10 @@ protected function loadFormData()
if ($this->getState('article.id') == 0)
{
$filters = (array) $app->getUserState('com_content.articles.filter');
$data->set('state', $app->input->getInt('state', (isset($filters['published']) ? $filters['published'] : null)));
$data->set('catid', $app->input->getInt('catid', (isset($filters['category_id']) ? $filters['category_id'] : null)));
$data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null)));
$data->set('state', $app->input->getInt('state', (!empty($filters['published']) ? $filters['published'] : null)));
$data->set('catid', $app->input->getInt('catid', (!empty($filters['category_id']) ? $filters['category_id'] : null)));
$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))));
}
}

Expand Down
Expand Up @@ -41,6 +41,12 @@ public function install()
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_installer.redirect_url');

// Don't redirect to an external URL.
if (!JUri::isInternal($redirect_url))
{
$redirect_url = '';
}

if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_installer&view=install', false);
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_installer/controllers/update.php
Expand Up @@ -50,6 +50,12 @@ public function update()
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_installer.redirect_url');

// Don't redirect to an external URL.
if (!JUri::isInternal($redirect_url))
{
$redirect_url = '';
}

if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_installer&view=update', false);
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_languages/languages.php
Expand Up @@ -15,6 +15,6 @@
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
}

$controller = JControllerLegacy::getInstance('Languages');
$controller = JControllerLegacy::getInstance('Languages');
$controller->execute(JFactory::getApplication()->input->get('task'));
$controller->redirect();
15 changes: 12 additions & 3 deletions administrator/components/com_login/controller.php
Expand Up @@ -59,7 +59,11 @@ public function login()

if (!($result instanceof Exception))
{
$app->redirect($return);
// Only redirect to an internal URL.
if (JUri::isInternal($return))
{
$app->redirect($return);
}
}

parent::display();
Expand All @@ -86,9 +90,14 @@ public function logout()

if (!($result instanceof Exception))
{
$model = $this->getModel('login');
$model = $this->getModel('login');
$return = $model->getState('return');
$app->redirect($return);

// Only redirect to an internal URL.
if (JUri::isInternal($return))
{
$app->redirect($return);
}
}

parent::display();
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_media/controllers/file.php
Expand Up @@ -44,6 +44,12 @@ public function upload()
$return = JFactory::getSession()->get('com_media.return_url');
$this->folder = $this->input->get('folder', '', 'path');

// Don't redirect to an external URL.
if (!JUri::isInternal($return))
{
$return = '';
}

// Set the redirect
if ($return)
{
Expand Down
8 changes: 4 additions & 4 deletions administrator/components/com_modules/models/module.php
Expand Up @@ -596,10 +596,10 @@ protected function loadFormData()
if (!$data->id)
{
$filters = (array) $app->getUserState('com_modules.modules.filter');
$data->set('published', $app->input->getInt('published', (isset($filters['state']) ? $filters['state'] : null)));
$data->set('position', $app->input->getInt('position', (isset($filters['position']) ? $filters['position'] : null)));
$data->set('language', $app->input->getString('language', (isset($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (isset($filters['access']) ? $filters['access'] : null)));
$data->set('published', $app->input->getInt('published', (!empty($filters['state']) ? $filters['state'] : null)));
$data->set('position', $app->input->getInt('position', (!empty($filters['position']) ? $filters['position'] : null)));
$data->set('language', $app->input->getString('language', (!empty($filters['language']) ? $filters['language'] : null)));
$data->set('access', $app->input->getInt('access', (!empty($filters['access']) ? $filters['access'] : JFactory::getConfig()->get('access'))));
}

// This allows us to inject parameter settings into a new module.
Expand Down
Expand Up @@ -20,6 +20,12 @@

$input = JFactory::getApplication()->input;

// No access if not global SuperUser
if (!JFactory::getUser()->authorise('core.admin'))
{
JFactory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
}

if ($this->type == 'image')
{
JHtml::_('script', 'system/jquery.Jcrop.min.js', false, true);
Expand Down Expand Up @@ -296,9 +302,14 @@ function clearCoords()
<div class="span4">
<legend><?php echo JText::_('COM_TEMPLATES_OVERRIDES_MODULES');?></legend>
<ul class="nav nav-list">
<?php $token = JSession::getFormToken() . '=' . 1; ?>
<?php foreach($this->overridesList['modules'] as $module): ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_templates&view=template&task=template.overrides&folder=' . $module->path . '&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $module->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token;
?>
<a href="<?php echo JRoute::_($overrideLinkUrl); ?>">
<span class="icon-copy"></span>&nbsp;<?php echo $module->name; ?>
</a>
</li>
Expand All @@ -308,6 +319,7 @@ function clearCoords()
<div class="span4">
<legend><?php echo JText::_('COM_TEMPLATES_OVERRIDES_COMPONENTS');?></legend>
<ul class="nav nav-list">
<?php $token = JSession::getFormToken() . '=' . 1; ?>
<?php foreach ($this->overridesList['components'] as $key => $value): ?>
<li class="component-folder">
<a href="#" class="component-folder-url">
Expand All @@ -316,7 +328,11 @@ function clearCoords()
<ul class="nav nav-list">
<?php foreach ($value as $view): ?>
<li>
<a class="component-file-url" href="<?php echo JRoute::_('index.php?option=com_templates&view=template&task=template.overrides&folder=' . $view->path . '&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $view->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token;
?>
<a class="component-file-url" href="<?php echo JRoute::_($overrideLinkUrl); ?>">
<span class="icon-copy"></span>&nbsp;<?php echo $view->name; ?>
</a>
</li>
Expand All @@ -329,9 +345,14 @@ function clearCoords()
<div class="span4">
<legend><?php echo JText::_('COM_TEMPLATES_OVERRIDES_LAYOUTS');?></legend>
<ul class="nav nav-list">
<?php $token = JSession::getFormToken() . '=' . 1; ?>
<?php foreach($this->overridesList['layouts'] as $layout): ?>
<li>
<a href="<?php echo JRoute::_('index.php?option=com_templates&view=template&task=template.overrides&folder=' . $layout->path . '&id=' . $input->getInt('id') . '&file=' . $this->file); ?>">
<?php
$overrideLinkUrl = 'index.php?option=com_templates&view=template&task=template.overrides&folder=' . $layout->path
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token;
?>
<a href="<?php echo JRoute::_($overrideLinkUrl); ?>">
<span class="icon-copy"></span>&nbsp;<?php echo $layout->name; ?>
</a>
</li>
Expand Down Expand Up @@ -407,7 +428,13 @@ function clearCoords()
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a>
<a href="<?php echo JRoute::_('index.php?option=com_templates&task=template.delete&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" class="btn btn-danger"><?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?></a>
<?php
$token = JSession::getFormToken() . '=1';
$deleteLinkUrl = 'index.php?option=com_templates&task=template.delete'
. '&id=' . $input->getInt('id') . '&file=' . $this->file . '&' . $token;
$deleteLink = JRoute::_($deleteLinkUrl);
?>
<a href="<?php echo $deleteLink; ?>" class="btn btn-danger"><?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?></a>
</div>
</div>
<?php endif; ?>
Expand Down Expand Up @@ -439,7 +466,7 @@ class="well" >
<label><?php echo JText::_('COM_TEMPLATES_FILE_NAME');?></label>
<input type="text" name="name" required />
<input type="hidden" class="address" name="address" />

<?php echo JHtml::_('form.token'); ?>
<input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_CREATE');?>" class="btn btn-primary" />
</fieldset>
</form>
Expand All @@ -448,6 +475,7 @@ class="well" enctype="multipart/form-data" >
<fieldset>
<input type="hidden" class="address" name="address" />
<input type="file" name="files" required />
<?php echo JHtml::_('form.token'); ?>
<input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_UPLOAD');?>" class="btn btn-primary" />
</fieldset>
</form>
Expand All @@ -462,6 +490,7 @@ class="well" enctype="multipart/form-data" >
<input type="text" id="new_name" name="new_name" required />
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
<input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_COPY_FILE');?>" class="btn btn-primary" />
</fieldset>
</form>
Expand All @@ -488,7 +517,7 @@ class="well" >
<label><?php echo JText::_('COM_TEMPLATES_FOLDER_NAME');?></label>
<input type="text" name="name" required />
<input type="hidden" class="address" name="address" />

<?php echo JHtml::_('form.token'); ?>
<input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_CREATE');?>" class="btn btn-primary" />
</fieldset>
</form>
Expand All @@ -499,6 +528,7 @@ class="well" >
<fieldset>
<a href="#" class="btn" data-dismiss="modal"><?php echo JText::_('COM_TEMPLATES_TEMPLATE_CLOSE'); ?></a>
<input type="hidden" class="address" name="address" />
<?php echo JHtml::_('form.token'); ?>
<input type="submit" value="<?php echo JText::_('COM_TEMPLATES_BUTTON_DELETE');?>" class="btn btn-danger" />
</fieldset>
</form>
Expand Down
@@ -0,0 +1,27 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_templates
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('_JEXEC') or die;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

JHtml::_('bootstrap.tooltip');

$input = JFactory::getApplication()->input;
?>
<form action="<?php echo JRoute::_('index.php?option=com_templates&view=template&id=' . $input->getInt('id') . '&file=' . $this->file); ?>" method="post" name="adminForm" id="adminForm" class="form-horizontal">
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'description')); ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'description', JText::_('COM_TEMPLATES_TAB_DESCRIPTION', true)); ?>
<?php echo $this->loadTemplate('description');?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<input type="hidden" name="task" value="" />
<?php echo JHtml::_('form.token'); ?>
</form>

0 comments on commit ac76274

Please sign in to comment.