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: 4 additions & 4 deletions libraries/cms/application/administrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public static function purgeMessages()
$config = $db->loadObject();

// Check if auto_purge value set
if (is_object($config) and $config->cfg_name == 'auto_purge')
if (is_object($config) and $config->cfg_name === 'auto_purge')
{
$purge = $config->cfg_value;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ protected function render()
$component = $input->getCmd('option', 'com_login');
$file = $input->getCmd('tmpl', 'index');

if ($component == 'com_login')
if ($component === 'com_login')
{
$file = 'login';
}
Expand All @@ -419,7 +419,7 @@ protected function render()
$rootUser = $this->get('root_user');

if (property_exists('JConfig', 'root_user')
&& (JFactory::getUser()->get('username') == $rootUser || JFactory::getUser()->id === (string) $rootUser))
&& (JFactory::getUser()->get('username') === $rootUser || JFactory::getUser()->id === (string) $rootUser))
{
$this->enqueueMessage(
JText::sprintf(
Expand Down Expand Up @@ -449,7 +449,7 @@ protected function route()
{
$uri = JUri::getInstance();

if ($this->get('force_ssl') >= 1 && strtolower($uri->getScheme()) != 'https')
if ($this->get('force_ssl') >= 1 && strtolower($uri->getScheme()) !== 'https')
{
// Forward to https
$uri->setScheme('https');
Expand Down
15 changes: 8 additions & 7 deletions libraries/cms/application/cms.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function execute()
}

// If gzip compression is enabled in configuration and the server is compliant, compress the output.
if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler'))
if ($this->get('gzip') && !ini_get('zlib.output_compression') && ini_get('output_handler') !== 'ob_gzhandler')
{
$this->compress();

Expand Down Expand Up @@ -332,7 +332,7 @@ protected function checkUserRequireReset($option, $view, $layout, $tasks)
if (array_search($this->input->getCmd('option', '') . '/' . $task, $tasks) === false)
{
// Check short task version, must be on the same option of the view
if ($this->input->getCmd('option', '') != $option || array_search($task, $tasks) === false)
if ($this->input->getCmd('option', '') !== $option || array_search($task, $tasks) === false)
{
// Not permitted task
$redirect = true;
Expand All @@ -341,7 +341,8 @@ protected function checkUserRequireReset($option, $view, $layout, $tasks)
}
else
{
if ($this->input->getCmd('option', '') != $option || $this->input->getCmd('view', '') != $view || $this->input->getCmd('layout', '') != $layout)
if ($this->input->getCmd('option', '') !== $option || $this->input->getCmd('view', '') !== $view
|| $this->input->getCmd('layout', '') !== $layout)
{
// Requested a different option/view/layout
$redirect = true;
Expand Down Expand Up @@ -824,8 +825,8 @@ public function loadSession(JSession $session = null)
// Get the session handler from the configuration.
$handler = $this->get('session_handler', 'none');

if (($handler != 'database' && ($time % 2 || $session->isNew()))
|| ($handler == 'database' && $session->isNew()))
if (($handler !== 'database' && ($time % 2 || $session->isNew()))
|| ($handler === 'database' && $session->isNew()))
{
$this->checkSession();
}
Expand Down Expand Up @@ -913,7 +914,7 @@ public function login($credentials, $options = array())
*/
$user = JFactory::getUser();

if ($response->type == 'Cookie')
if ($response->type === 'Cookie')
{
$user->set('cookieLogin', true);
}
Expand Down Expand Up @@ -1189,7 +1190,7 @@ public function setUserState($key, $value)
public function toString($compress = false)
{
// Don't compress something if the server is going to do it anyway. Waste of time.
if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler')
if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler') !== 'ob_gzhandler')
{
$this->compress();
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/cms/application/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function stringURLSafe($string, $language = '')
}
else
{
if ($language == '*' || $language == '')
if ($language === '*' || $language === '')
{
$languageParams = JComponentHelper::getParams('com_languages');
$language = $languageParams->get('site');
Expand Down Expand Up @@ -255,7 +255,7 @@ public static function parseXMLLangMetaFile($path)
*
* Should be 'metafile'.
*/
if ($xml->getName() != 'metafile')
if ($xml->getName() !== 'metafile')
{
unset($xml);

Expand Down
6 changes: 3 additions & 3 deletions libraries/cms/application/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public function getTemplate($params = false)
{
foreach ($templates as $tmpl)
{
if ($tmpl->template == $template_override)
if ($tmpl->template === $template_override)
{
$template = $tmpl;
break;
Expand All @@ -549,7 +549,7 @@ public function getTemplate($params = false)

foreach ($templates as $tmpl)
{
if ($tmpl->template == 'beez3')
if ($tmpl->template === 'beez3')
{
$template = $tmpl;
break;
Expand Down Expand Up @@ -748,7 +748,7 @@ protected function render()
$template = $this->getTemplate(true);
$file = $this->input->get('tmpl', 'index');

if (!$this->get('offline') && ($file == 'offline'))
if (!$this->get('offline') && $file === 'offline')
{
$this->set('themeFile', 'index.php');
}
Expand Down
10 changes: 5 additions & 5 deletions libraries/cms/component/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ public static function filterText($text)
$filterData = $filters->$groupId;
$filterType = strtoupper($filterData->filter_type);

if ($filterType == 'NH')
if ($filterType === 'NH')
{
// Maximum HTML filtering.
}
elseif ($filterType == 'NONE')
elseif ($filterType === 'NONE')
{
// No HTML filtering.
$unfiltered = true;
Expand Down Expand Up @@ -200,13 +200,13 @@ public static function filterText($text)

// Collect the blacklist or whitelist tags and attributes.
// Each list is cummulative.
if ($filterType == 'BL')
if ($filterType === 'BL')
{
$blackList = true;
$blackListTags = array_merge($blackListTags, $tempTags);
$blackListAttributes = array_merge($blackListAttributes, $tempAttributes);
}
elseif ($filterType == 'CBL')
elseif ($filterType === 'CBL')
{
// Only set to true if Tags or Attributes were added
if ($tempTags || $tempAttributes)
Expand All @@ -216,7 +216,7 @@ public static function filterText($text)
$customListAttributes = array_merge($customListAttributes, $tempAttributes);
}
}
elseif ($filterType == 'WL')
elseif ($filterType === 'WL')
{
$whiteList = true;
$whiteListTags = array_merge($whiteListTags, $tempTags);
Expand Down
8 changes: 4 additions & 4 deletions libraries/cms/component/router/rules/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public function preprocess(&$query)
// Check if the active menuitem matches the requested language
$active = $this->router->menu->getActive();

if ($active && $active->component == 'com_' . $this->router->getName()
&& ($language == '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled()))
if ($active && $active->component === 'com_' . $this->router->getName()
&& ($language === '*' || in_array($active->language, array('*', $language)) || !JLanguageMultilang::isEnabled()))
{
$query['Itemid'] = $active->id;
return;
Expand Down Expand Up @@ -194,7 +194,7 @@ protected function buildLookup($language = '*')
* language == * cannot override existing entries
*/
if (isset($item->query[$views[$view]->key])
&& (!isset($this->lookup[$language][$view . $layout][$item->query[$views[$view]->key]]) || $item->language != '*'))
&& (!isset($this->lookup[$language][$view . $layout][$item->query[$views[$view]->key]]) || $item->language !== '*'))
{
$this->lookup[$language][$view . $layout][$item->query[$views[$view]->key]] = $item->id;
$this->lookup[$language][$view][$item->query[$views[$view]->key]] = $item->id;
Expand All @@ -207,7 +207,7 @@ protected function buildLookup($language = '*')
* language != * can override existing entries
* language == * cannot override existing entries
*/
if (!isset($this->lookup[$language][$view . $layout]) || $item->language != '*')
if (!isset($this->lookup[$language][$view . $layout]) || $item->language !== '*')
{
$this->lookup[$language][$view . $layout] = $item->id;
$this->lookup[$language][$view] = $item->id;
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/component/router/rules/nomenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function build(&$query, &$segments)
{
$item = $this->router->menu->getItem($query['Itemid']);

if (!isset($query['option']) || ($item && $item->query['option'] == $query['option']))
if (!isset($query['option']) || ($item && $item->query['option'] === $query['option']))
{
$menu_found = true;
}
Expand Down
10 changes: 5 additions & 5 deletions libraries/cms/component/router/rules/standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function parse(&$segments, &$vars)
{
if (!$view->key)
{
if ($view->name == $segment)
if ($view->name === $segment)
{
// The segment is a view name
$parent = $views[$vars['view']];
Expand Down Expand Up @@ -191,7 +191,7 @@ public function build(&$query, &$segments)
$views = $this->router->getViews();

// Return directly when the URL of the Itemid is identical with the URL to build
if (isset($item->query['view']) && $item->query['view'] == $query['view'])
if (isset($item->query['view']) && $item->query['view'] === $query['view'])
{
$view = $views[$query['view']];

Expand All @@ -208,7 +208,7 @@ public function build(&$query, &$segments)

unset($query['view']);

if (isset($item->query['layout']) && isset($query['layout']) && $item->query['layout'] == $query['layout'])
if (isset($item->query['layout']) && isset($query['layout']) && $item->query['layout'] === $query['layout'])
{
unset($query['layout']);
}
Expand All @@ -218,7 +218,7 @@ public function build(&$query, &$segments)

if (!$view->key)
{
if (isset($item->query['layout']) && isset($query['layout']) && $item->query['layout'] == $query['layout'])
if (isset($item->query['layout']) && isset($query['layout']) && $item->query['layout'] === $query['layout'])
{
unset($query['view'], $query['layout']);
return;
Expand Down Expand Up @@ -263,7 +263,7 @@ public function build(&$query, &$segments)
$segments[] = str_replace(':', '-', array_shift($ids));
}
}
elseif ($item->query['view'] != $view)
elseif ($item->query['view'] !== $view)
{
array_shift($path);
}
Expand Down
8 changes: 4 additions & 4 deletions libraries/cms/form/field/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ public function __set($name, $value)
case 'buttons':
$value = (string) $value;

if ($value == 'true' || $value == 'yes' || $value == '1')
if ($value === 'true' || $value === 'yes' || $value == '1')
{
$this->buttons = true;
}
elseif ($value == 'false' || $value == 'no' || $value == '0')
elseif ($value === 'false' || $value === 'no' || $value == '0')
{
$this->buttons = false;
}
Expand Down Expand Up @@ -210,11 +210,11 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
$hide = (string) $this->element['hide'];
$editorType = (string) $this->element['editor'];

if ($buttons == 'true' || $buttons == 'yes' || $buttons == '1')
if ($buttons === 'true' || $buttons === 'yes' || $buttons == '1')
{
$this->buttons = true;
}
elseif ($buttons == 'false' || $buttons == 'no' || $buttons == '0')
elseif ($buttons === 'false' || $buttons === 'no' || $buttons == '0')
{
$this->buttons = false;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/form/field/limitbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function getOptions()
asort($limits);

// Add an option to show all?
$showAll = isset($this->element['showall']) ? ($this->element['showall'] == 'true') : true;
$showAll = isset($this->element['showall']) ? $this->element['showall'] === 'true' : true;

if ($showAll)
{
Expand Down
4 changes: 2 additions & 2 deletions libraries/cms/form/field/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function setup(SimpleXMLElement $element, $value, $group = null)
{
$result = parent::setup($element, $value, $group);

if ($result == true)
if ($result === true)
{
$assetField = $this->element['asset_field'] ? (string) $this->element['asset_field'] : 'asset_id';

Expand Down Expand Up @@ -232,7 +232,7 @@ public function getLayoutData()

$asset = $this->asset;

if ($asset == '')
if ($asset === '')
{
$asset = JFactory::getApplication()->input->get('option');
}
Expand Down
8 changes: 4 additions & 4 deletions libraries/cms/form/field/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function getOptions()
}

// Block the possibility to set a tag as it own parent
if ($this->form->getName() == 'com_tags.tag')
if ($this->form->getName() === 'com_tags.tag')
{
$id = (int) $this->form->getValue('id', 0);

Expand Down Expand Up @@ -237,8 +237,8 @@ public function isNested()
if (is_null($this->isNested))
{
// If mode="nested" || ( mode not set & config = nested )
if ((isset($this->element['mode']) && $this->element['mode'] == 'nested')
|| (!isset($this->element['mode']) && $this->comParams->get('tag_field_ajax_mode', 1) == 0))
if (isset($this->element['mode']) && $this->element['mode'] === 'nested'
|| !isset($this->element['mode']) && $this->comParams->get('tag_field_ajax_mode', 1) == 0)
{
$this->isNested = true;
}
Expand All @@ -254,7 +254,7 @@ public function isNested()
*/
public function allowCustom()
{
if (isset($this->element['custom']) && $this->element['custom'] == 'deny')
if (isset($this->element['custom']) && $this->element['custom'] === 'deny')
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/form/field/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getLayoutData()
$name = JUser::getInstance($this->value)->name;
}
// Handle the special case for "current".
elseif (strtoupper($this->value) == 'CURRENT')
elseif (strtoupper($this->value) === 'CURRENT')
{
// 'CURRENT' is not a reasonable value to be placed in the html
$current = JFactory::getUser();
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/form/rule/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function test(SimpleXMLElement $element, $value, $group = null, Registry
}

// If the field is empty and not required, the field is valid.
$required = ((string) $element['required'] == 'true' || (string) $element['required'] == 'required');
$required = ((string) $element['required'] === 'true' || (string) $element['required'] === 'required');

if (!$required && empty($value))
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/cms/helper/contenthistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function store($table)

if ($historyRow = $historyTable->getHashMatch())
{
if (!$versionName || ($historyRow->version_note == $versionName))
if (!$versionName || ($historyRow->version_note === $versionName))
{
return true;
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/cms/helper/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function canUpload($file, $component = 'com_media')

jimport('joomla.filesystem.file');

if (str_replace(' ', '', $file['name']) != $file['name'] || $file['name'] !== JFile::makeSafe($file['name']))
if (str_replace(' ', '', $file['name']) !== $file['name'] || $file['name'] !== JFile::makeSafe($file['name']))
{
$app->enqueueMessage(JText::_('JLIB_MEDIA_ERROR_WARNFILENAME'), 'error');

Expand Down Expand Up @@ -362,13 +362,13 @@ public function countFiles($dir)

while (false !== ($entry = $d->read()))
{
if (substr($entry, 0, 1) != '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry)
if (substr($entry, 0, 1) !== '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry)
&& strpos($entry, '.html') === false && strpos($entry, '.php') === false)
{
$total_file++;
}

if (substr($entry, 0, 1) != '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry))
if (substr($entry, 0, 1) !== '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry))
{
$total_dir++;
}
Expand Down
Loading