Skip to content

Commit

Permalink
Merge branch 'staging' into 3.4-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakual committed Jul 11, 2014
2 parents 2615fa9 + c577ba2 commit d4c6bd2
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function createRestorationFile($basename = null)
{

JFolder::create($tempdir, 511);
JFile::write($tempdir . '/.htaccess', "order deny, allow\ndeny from all\nallow from none\n");
JFile::write($tempdir . '/.htaccess', "order deny,allow\ndeny from all\nallow from none\n");
}

// If it exists and it is unwritable, try creating a writable admintools subdirectory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JoomlaupdateViewDefault extends JViewLegacy
*
* @since 2.5.4
*/
public function display($tpl=null)
public function display($tpl = null)
{
// Get data from the model
$this->state = $this->get('State');
Expand All @@ -50,6 +50,7 @@ public function display($tpl=null)
{
JToolbarHelper::preferences('com_joomlaupdate');
}

JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_JOOMLA_UPDATE');

Expand All @@ -64,6 +65,12 @@ public function display($tpl=null)
$document->addScript('../media/com_joomlaupdate/default.js');
JHtml::_('stylesheet', 'media/mediamanager.css', array(), true);

if (!is_null($this->updateInfo['object']))
{
// Show the message if a update is found.
JFactory::getApplication()->enqueueMessage(JText::_('COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE'), 'notice');
}

// Render the view
parent::display($tpl);
}
Expand Down
30 changes: 0 additions & 30 deletions administrator/components/com_templates/models/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1150,36 +1150,6 @@ public function getFont()
}
}

/**
* Check the admin template.
*
* @return object object containing the id of the template.
*
* @since 3.2
*/
public function getHathor()
{
$app = JFactory::getApplication();
$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select('home');
$query->from('#__template_styles');
$query->where($db->quoteName('template') . ' = ' . $db->quote('hathor'));
$db->setQuery($query);

try
{
$result = $db->loadObject();
}
catch (RuntimeException $e)
{
$app->enqueueMessage($e->getMessage(), 'error');
}

return $result;
}

/**
* Copy a file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ class TemplatesViewTemplate extends JViewLegacy
*/
protected $font;

/**
* For checking if the template is hathor
*/
protected $hathor;

/**
* A nested array containing lst of files and folders
*/
Expand Down Expand Up @@ -111,7 +106,6 @@ public function display($tpl = null)
$this->state = $this->get('State');
$this->template = $this->get('Template');
$this->preview = $this->get('Preview');
$this->hathor = $this->get('Hathor');

$params = JComponentHelper::getParams('com_templates');
$imageTypes = explode(',', $params->get('image_formats'));
Expand Down Expand Up @@ -171,7 +165,8 @@ public function display($tpl = null)
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$app = JFactory::getApplication();
$app->input->set('hidemainmenu', true);
$canDo = JHelperContent::getActions('com_templates');

if ($canDo->get('core.edit') && $canDo->get('core.create') && $canDo->get('core.admin'))
Expand Down Expand Up @@ -218,8 +213,8 @@ protected function addToolbar()
}
}

// Add a copy template button (Hathor may not be available)
if ($this->hathor && $this->hathor->home == 0)
// Add a copy template button (Hathor override doesn't need the button)
if ($app->getTemplate() != 'hathor')
{
if ($showButton)
{
Expand All @@ -245,8 +240,8 @@ protected function addToolbar()
JToolbarHelper::modal('fileModal', 'icon-file', 'COM_TEMPLATES_BUTTON_FILE');
}

// Add a Rename file Button
if ($this->hathor && $this->hathor->home == 0)
// Add a Rename file Button (Hathor override doesn't need the button)
if ($app->getTemplate() != 'hathor')
{
if ($showButton && $this->type != 'home')
{
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.com_installer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZE="Small PHP maximum POST size"
COM_INSTALLER_MSG_WARNINGS_SMALLPOSTSIZEDESC="The maximum POST size sets the most amount of data that can be sent via POST to the server. This includes form submissions for articles, media (images, videos) and extensions. This value is less than 2MB which may impact on uploading large extensions. This is set in the php.ini under post_max_size"
COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZE="Small PHP file upload size"
COM_INSTALLER_MSG_WARNINGS_SMALLUPLOADSIZEDESC="The maximum file size for uploads is set to less than 2MB which may impact on uploading large extensions."
COM_INSTALLER_MSG_WARNINGS_UPDATE_NOTICE="Before updating ensure that the update is compatible with your Joomla! installation. If updating Joomla!, ensure installed extensions are available for the new Joomla! version."
COM_INSTALLER_MSG_WARNINGS_UPDATE_NOTICE="Before updating ensure that the update is compatible with your Joomla! installation."
COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOST="PHP Upload Size bigger than POST size"
COM_INSTALLER_MSG_WARNINGS_UPLOADBIGGERTHANPOSTDESC="The value of the upload_max_filesize in the php.ini file is greater than the post_max_size variable. The post_max_size variable will take precedence here and block requests larger than it. This is generally a server misconfiguration when trying to increase upload sizes. Please increase the upload_max_filesize to at least match the post_max_size variable or vice versa"
COM_INSTALLER_N_EXTENSIONS_PUBLISHED="%d extensions successfully enabled."
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/en-GB.com_joomlaupdate.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATES="No updates available"
COM_JOOMLAUPDATE_VIEW_DEFAULT_NOUPDATESNOTICE="You already have the latest Joomla! version, %s."
COM_JOOMLAUPDATE_VIEW_DEFAULT_PACKAGE="Update package URL"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATEFOUND="A Joomla! update was found"
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATE_NOTICE="Before you update Joomla!, ensure that the installed extensions are available for the new Joomla! version."
COM_JOOMLAUPDATE_VIEW_PROGRESS="Update progress"
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESEXTRACTED="Bytes extracted"
COM_JOOMLAUPDATE_VIEW_UPDATE_BYTESREAD="Bytes read"
Expand Down
1 change: 0 additions & 1 deletion layouts/joomla/content/blog_style_default_item_title.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
$params = $displayData->params;
$canEdit = $displayData->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.framework');
?>

<?php if ($params->get('show_title') || $displayData->state == 0 || ($params->get('show_author') && !empty($displayData->author ))) : ?>
Expand Down
28 changes: 8 additions & 20 deletions libraries/cms/html/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class JHtmlEmail
*/
public static function cloak($mail, $mailto = true, $text = '', $email = true)
{
// Convert text
// Convert mail
$mail = static::convertEncoding($mail);

// Split email by @ symbol
Expand All @@ -44,8 +44,9 @@ public static function cloak($mail, $mailto = true, $text = '', $email = true)
// Random number
$rand = rand(1, 100000);

$replacement = "<script type='text/javascript'>";
$replacement = '<div id="cloak' . $rand . '">' . JText::_('JLIB_HTML_CLOAKING') . '</div>' . "<script type='text/javascript'>";
$replacement .= "\n <!--";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML = '';";
$replacement .= "\n var prefix = '&#109;a' + 'i&#108;' + '&#116;o';";
$replacement .= "\n var path = 'hr' + 'ef' + '=';";
$replacement .= "\n var addy" . $rand . " = '" . @$mail[0] . "' + '&#64;';";
Expand All @@ -61,7 +62,6 @@ public static function cloak($mail, $mailto = true, $text = '', $email = true)

if ($email)
{

// Split email by @ symbol
$text = explode('@', $text);
$text_parts = explode('.', $text[1]);
Expand All @@ -73,35 +73,23 @@ public static function cloak($mail, $mailto = true, $text = '', $email = true)
$replacement .= "\n var addy_text" . $rand . " = '" . $text . "';";
}

$replacement .= "\n document.write('<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>'";
$replacement .= "+ addy_text" . $rand;
$replacement .= "+ '<\/a>');";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>'+addy_text" . $rand . "+'<\/a>';";
}
else
{
$replacement .= "\n document.write('<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>'";
$replacement .= "+ addy" . $rand;
$replacement .= "+ '<\/a>');";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<a ' + path + '\'' + prefix + ':' + addy" . $rand . " + '\'>';";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML += 'addy" . $rand . "';";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML += '<\/a>';";
}
}
else
{
$replacement .= "\n document.write(addy" . $rand . ");";
$replacement .= "\n document.getElementById('cloak$rand').innerHTML += 'addy" . $rand . "';";
}

$replacement .= "\n //-->";
$replacement .= '\n </script>';

// XHTML compliance no Javascript text handling
$replacement .= "<script type='text/javascript'>";
$replacement .= "\n <!--";
$replacement .= "\n document.write('<span style=\'display: none;\'>'+ '";
$replacement .= JText::_('JLIB_HTML_CLOAKING');
$replacement .= "'+ '</'";
$replacement .= "+ 'span>');";
$replacement .= "\n //-->";
$replacement .= "\n </script>";

return $replacement;
}

Expand Down
23 changes: 17 additions & 6 deletions libraries/joomla/cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,23 @@ public static function makeId()
}

// Platform defaults
$registeredurlparams->format = 'WORD';
$registeredurlparams->option = 'WORD';
$registeredurlparams->view = 'WORD';
$registeredurlparams->layout = 'WORD';
$registeredurlparams->tpl = 'CMD';
$registeredurlparams->id = 'INT';
$defaulturlparams = array(
'format' => 'WORD',
'option' => 'WORD',
'view' => 'WORD',
'layout' => 'WORD',
'tpl' => 'CMD',
'id' => 'INT'
);

// Use platform defaults if parameter doesn't already exist.
foreach($defaulturlparams as $param => $type)
{
if (!property_exists($registeredurlparams, $param))
{
$registeredurlparams->$param = $type;
}
}

$safeuriaddon = new stdClass;

Expand Down
2 changes: 1 addition & 1 deletion media/com_joomlaupdate/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function doAjax(data, successCallback, errorCallback)
var message = 'AJAX Loading Error: '+req.statusText;
if (joomlaupdate_error_callback != null)
{
joomlaupdate_error_callback(msg);
joomlaupdate_error_callback(message);
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions plugins/authentication/cookie/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public function onUserAuthenticate($credentials, $options, &$response)
return false;
}

$response->type = 'Cookie';

// Get cookie
$cookieName = JUserHelper::getShortHashedUserAgent();
$cookieValue = $this->app->input->cookie->get($cookieName);
Expand All @@ -78,6 +76,8 @@ public function onUserAuthenticate($credentials, $options, &$response)
return false;
}

$response->type = 'Cookie';

// Filter series since we're going to use it in the query
$filter = new JFilterInput;
$series = $filter->clean($cookieArray[1], 'ALNUM');
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/suites/libraries/cms/html/JHtmlEmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testCloak()
{
$this->assertThat(
JHtmlEmail::cloak('admin@joomla.org'),
$this->StringContains("document.write('<a ' + path + '\'' + prefix + ':' + addy"),
$this->StringContains(".innerHTML += '<a ' + path + '\'' + prefix + ':' + addy"),
'Cloak e-mail with mailto link'
);

Expand Down

0 comments on commit d4c6bd2

Please sign in to comment.