Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions libraries/cms/component/router/rules/standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ public function build(&$query, &$segments)
{
if (isset($item->query['layout']) && isset($query['layout']) && $item->query['layout'] == $query['layout'])
{
unset($query['view']);
unset($query['layout']);

unset($query['view'], $query['layout']);
return;
}
}
Expand Down Expand Up @@ -292,9 +290,7 @@ public function build(&$query, &$segments)

if ($found)
{
unset($query['layout']);
unset($query[$views[$query['view']]->key]);
unset($query['view']);
unset($query['layout'], $query[$views[$query['view']]->key], $query['view']);
}
}
}
35 changes: 14 additions & 21 deletions libraries/cms/html/behavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ public static function core()

JHtml::_('script', 'system/core.js', array('version' => 'auto', 'relative' => true));
static::$loaded[__METHOD__] = true;

return;
}

/**
Expand Down Expand Up @@ -287,16 +285,16 @@ public static function tooltip($selector = '.hasTip', $params = array())
static::framework(true);

// Setup options object
$opt['maxTitleChars'] = (isset($params['maxTitleChars']) && $params['maxTitleChars']) ? (int) $params['maxTitleChars'] : 50;
$opt['maxTitleChars'] = isset($params['maxTitleChars']) && $params['maxTitleChars'] ? (int) $params['maxTitleChars'] : 50;

// Offsets needs an array in the format: array('x'=>20, 'y'=>30)
$opt['offset'] = (isset($params['offset']) && (is_array($params['offset']))) ? $params['offset'] : null;
$opt['showDelay'] = (isset($params['showDelay'])) ? (int) $params['showDelay'] : null;
$opt['hideDelay'] = (isset($params['hideDelay'])) ? (int) $params['hideDelay'] : null;
$opt['className'] = (isset($params['className'])) ? $params['className'] : null;
$opt['fixed'] = (isset($params['fixed']) && ($params['fixed'])) ? true : false;
$opt['onShow'] = (isset($params['onShow'])) ? '\\' . $params['onShow'] : null;
$opt['onHide'] = (isset($params['onHide'])) ? '\\' . $params['onHide'] : null;
$opt['offset'] = isset($params['offset']) && is_array($params['offset']) ? $params['offset'] : null;
$opt['showDelay'] = isset($params['showDelay']) ? (int) $params['showDelay'] : null;
$opt['hideDelay'] = isset($params['hideDelay']) ? (int) $params['hideDelay'] : null;
$opt['className'] = isset($params['className']) ? $params['className'] : null;
$opt['fixed'] = isset($params['fixed']) && $params['fixed'];
$opt['onShow'] = isset($params['onShow']) ? '\\' . $params['onShow'] : null;
$opt['onHide'] = isset($params['onHide']) ? '\\' . $params['onHide'] : null;

$options = JHtml::getJSObject($opt);

Expand Down Expand Up @@ -372,14 +370,14 @@ public static function modal($selector = 'a.modal', $params = array())
JLog::add('JHtmlBehavior::modal is deprecated. Use the modal equivalent from bootstrap.', JLog::WARNING, 'deprecated');

// Setup options object
$opt['ajaxOptions'] = (isset($params['ajaxOptions']) && is_array($params['ajaxOptions'])) ? $params['ajaxOptions'] : null;
$opt['ajaxOptions'] = isset($params['ajaxOptions']) && is_array($params['ajaxOptions']) ? $params['ajaxOptions'] : null;
$opt['handler'] = isset($params['handler']) ? $params['handler'] : null;
$opt['parseSecure'] = isset($params['parseSecure']) ? (bool) $params['parseSecure'] : null;
$opt['closable'] = isset($params['closable']) ? (bool) $params['closable'] : null;
$opt['closeBtn'] = isset($params['closeBtn']) ? (bool) $params['closeBtn'] : null;
$opt['iframePreload'] = isset($params['iframePreload']) ? (bool) $params['iframePreload'] : null;
$opt['iframeOptions'] = (isset($params['iframeOptions']) && is_array($params['iframeOptions'])) ? $params['iframeOptions'] : null;
$opt['size'] = (isset($params['size']) && is_array($params['size'])) ? $params['size'] : null;
$opt['iframeOptions'] = isset($params['iframeOptions']) && is_array($params['iframeOptions']) ? $params['iframeOptions'] : null;
$opt['size'] = isset($params['size']) && is_array($params['size']) ? $params['size'] : null;
$opt['shadow'] = isset($params['shadow']) ? $params['shadow'] : null;
$opt['overlay'] = isset($params['overlay']) ? $params['overlay'] : null;
$opt['onOpen'] = isset($params['onOpen']) ? $params['onOpen'] : null;
Expand Down Expand Up @@ -896,17 +894,12 @@ public static function tabstate()
*/
public static function polyfill($polyfillTypes = null, $conditionalBrowser = null)
{
if (is_null($polyfillTypes))
if ($polyfillTypes === null)
{
return false;
}

if (!is_array($polyfillTypes))
{
$polyfillTypes = array($polyfillTypes);
return;
}

foreach ($polyfillTypes as $polyfillType)
foreach ((array) $polyfillTypes as $polyfillType)
{
$sig = md5(serialize(array($polyfillType, $conditionalBrowser)));

Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/html/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ public static function startAccordion($selector = 'myAccordian', $params = array

// Setup options object
$opt['parent'] = isset($params['parent']) ? ($params['parent'] == true ? '#' . $selector : $params['parent']) : false;
$opt['toggle'] = isset($params['toggle']) ? (boolean) $params['toggle'] : ($opt['parent'] === false || isset($params['active']) ? false : true);
$opt['toggle'] = isset($params['toggle']) ? (boolean) $params['toggle'] : !($opt['parent'] === false || isset($params['active']));
$onShow = isset($params['onShow']) ? (string) $params['onShow'] : null;
$onShown = isset($params['onShown']) ? (string) $params['onShown'] : null;
$onHide = isset($params['onHide']) ? (string) $params['onHide'] : null;
Expand Down
5 changes: 1 addition & 4 deletions libraries/cms/html/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -1088,11 +1088,8 @@ public static function calendar($value, $name, $id, $format = '%Y-%m-%d', $attri
*/
public static function addIncludePath($path = '')
{
// Force path to array
settype($path, 'array');

// Loop through the path directories
foreach ($path as $dir)
foreach ((array) $path as $dir)
{
if (!empty($dir) && !in_array($dir, static::$includePaths))
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/html/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected static function loadBehavior($group, $params = array())
$opt['descriptionSelector'] = 'dd.tabs';

// When use storage is set and value is false - By default we allow to use storage
$opt['useStorage'] = (isset($params['useCookie']) && !$params['useCookie']) ? false : true;
$opt['useStorage'] = !(isset($params['useCookie']) && !$params['useCookie']);

$options = JHtml::getJSObject($opt);

Expand Down
6 changes: 2 additions & 4 deletions libraries/cms/menu/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ public function getItems($attributes, $values, $firstonly = false)
}
elseif ($values[$key] === null)
{
unset($attributes[$key]);
unset($values[$key]);
unset($attributes[$key], $values[$key]);
}

// Filter by access level if not set
Expand All @@ -180,8 +179,7 @@ public function getItems($attributes, $values, $firstonly = false)
}
elseif ($values[$key] === null)
{
unset($attributes[$key]);
unset($values[$key]);
unset($attributes[$key], $values[$key]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/search/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function logSearch($term, $component)
->from($db->quoteName('#__core_log_searches'))
->where($db->quoteName('search_term') . ' = ' . $db->quote($search_term));
$db->setQuery($query);
$hits = intval($db->loadResult());
$hits = (int) $db->loadResult();

// Reset the $query object
$query->clear();
Expand Down
5 changes: 1 addition & 4 deletions libraries/cms/toolbar/toolbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,8 @@ public function loadButtonType($type, $new = false)
*/
public function addButtonPath($path)
{
// Just force path to array.
settype($path, 'array');

// Loop through the path directories.
foreach ($path as $dir)
foreach ((array) $path as $dir)
{
// No surrounding spaces allowed!
$dir = trim($dir);
Expand Down