Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion libraries/cms/html/behavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public static function tooltip($selector = '.hasTip', $params = array())
$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['fixed'] = (isset($params['fixed']) && ($params['fixed']));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove parentheses in ($params['fixed']). Also the outside parentheses can be removed in this line and the other lines too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed. Thanks. Have found one or two other improvements as well. Commit follows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out, some of the other improvements, were already in other PR's which have not been merged yet. It would be good to get the other improvements merged, too.

$opt['onShow'] = (isset($params['onShow'])) ? '\\' . $params['onShow'] : null;
$opt['onHide'] = (isset($params['onHide'])) ? '\\' . $params['onHide'] : null;

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 @@ -1080,11 +1080,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
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