diff --git a/plugins/authentication/cookie/cookie.php b/plugins/authentication/cookie/cookie.php index 8f1d8b747b8de..36c8061510ef0 100644 --- a/plugins/authentication/cookie/cookie.php +++ b/plugins/authentication/cookie/cookie.php @@ -224,7 +224,7 @@ public function onUserAfterLogin($options) return false; } - if (isset($options['responseType']) && $options['responseType'] == 'Cookie') + if (isset($options['responseType']) && $options['responseType'] === 'Cookie') { // Logged in using a cookie $cookieName = 'joomla_remember_me_' . JUserHelper::getShortHashedUserAgent(); diff --git a/plugins/authentication/joomla/joomla.php b/plugins/authentication/joomla/joomla.php index a929397647ce7..8b0e8721c52a2 100644 --- a/plugins/authentication/joomla/joomla.php +++ b/plugins/authentication/joomla/joomla.php @@ -119,7 +119,7 @@ public function onUserAuthenticate($credentials, $options, &$response) } // Check if the user has enabled two factor authentication - if (empty($otpConfig->method) || ($otpConfig->method == 'none')) + if (empty($otpConfig->method) || ($otpConfig->method === 'none')) { // Warn the user if they are using a secret code but they have not // enabled two factor auth in their account. @@ -170,7 +170,7 @@ public function onUserAuthenticate($credentials, $options, &$response) // Did the user use an OTEP instead? if (empty($otpConfig->otep)) { - if (empty($otpConfig->method) || ($otpConfig->method == 'none')) + if (empty($otpConfig->method) || ($otpConfig->method === 'none')) { // Two factor authentication is not enabled on this account. // Any string is assumed to be a valid OTEP. diff --git a/plugins/captcha/recaptcha/recaptcha.php b/plugins/captcha/recaptcha/recaptcha.php index 92dca795e8676..8f36ba0c401a8 100644 --- a/plugins/captcha/recaptcha/recaptcha.php +++ b/plugins/captcha/recaptcha/recaptcha.php @@ -45,7 +45,7 @@ public function onInit($id = 'dynamic_recaptcha_1') throw new Exception(JText::_('PLG_RECAPTCHA_ERROR_NO_PUBLIC_KEY')); } - if ($this->params->get('version', '1.0') == '1.0') + if ($this->params->get('version', '1.0') === '1.0') { JHtml::_('jquery.framework'); @@ -82,7 +82,7 @@ public function onInit($id = 'dynamic_recaptcha_1') */ public function onDisplay($name = null, $id = 'dynamic_recaptcha_1', $class = '') { - if ($this->params->get('version', '1.0') == '1.0') + if ($this->params->get('version', '1.0') === '1.0') { return '
'; } diff --git a/plugins/content/emailcloak/emailcloak.php b/plugins/content/emailcloak/emailcloak.php index a71abc3a23a8a..59279d46a29fb 100644 --- a/plugins/content/emailcloak/emailcloak.php +++ b/plugins/content/emailcloak/emailcloak.php @@ -31,7 +31,7 @@ class PlgContentEmailcloak extends JPlugin public function onContentPrepare($context, &$row, &$params, $page = 0) { // Don't run this plugin when the content is being indexed - if ($context == 'com_finder.indexer') + if ($context === 'com_finder.indexer') { return true; } diff --git a/plugins/content/joomla/joomla.php b/plugins/content/joomla/joomla.php index 240193fd07758..741258af3093c 100644 --- a/plugins/content/joomla/joomla.php +++ b/plugins/content/joomla/joomla.php @@ -33,7 +33,7 @@ class PlgContentJoomla extends JPlugin public function onContentAfterSave($context, $article, $isNew) { // Check we are handling the frontend edit form. - if ($context != 'com_content.form') + if ($context !== 'com_content.form') { return true; } @@ -108,7 +108,7 @@ public function onContentAfterSave($context, $article, $isNew) public function onContentBeforeDelete($context, $data) { // Skip plugin if we are deleting something other than categories - if ($context != 'com_categories.category') + if ($context !== 'com_categories.category') { return true; } diff --git a/plugins/content/loadmodule/loadmodule.php b/plugins/content/loadmodule/loadmodule.php index 4aa7ae0bd5c3d..0814c8d0c7d3a 100644 --- a/plugins/content/loadmodule/loadmodule.php +++ b/plugins/content/loadmodule/loadmodule.php @@ -36,7 +36,7 @@ class PlgContentLoadmodule extends JPlugin public function onContentPrepare($context, &$article, &$params, $page = 0) { // Don't run this plugin when the content is being indexed - if ($context == 'com_finder.indexer') + if ($context === 'com_finder.indexer') { return true; } diff --git a/plugins/content/pagebreak/pagebreak.php b/plugins/content/pagebreak/pagebreak.php index b1d31d3c00b3d..72bdf928bdf7c 100644 --- a/plugins/content/pagebreak/pagebreak.php +++ b/plugins/content/pagebreak/pagebreak.php @@ -44,7 +44,7 @@ class PlgContentPagebreak extends JPlugin */ public function onContentPrepare($context, &$row, &$params, $page = 0) { - $canProceed = $context == 'com_content.article'; + $canProceed = $context === 'com_content.article'; if (!$canProceed) { @@ -87,7 +87,7 @@ public function onContentPrepare($context, &$row, &$params, $page = 0) $page = 0; } - if ($params->get('intro_only') || $params->get('popup') || $full || $view != 'article') + if ($params->get('intro_only') || $params->get('popup') || $full || $view !== 'article') { $row->text = preg_replace($regex, '', $row->text); @@ -158,7 +158,7 @@ public function onContentPrepare($context, &$row, &$params, $page = 0) // Reset the text, we already hold it in the $text array. $row->text = ''; - if ($style == 'pages') + if ($style === 'pages') { // Display TOC. if ($hasToc) diff --git a/plugins/content/pagenavigation/pagenavigation.php b/plugins/content/pagenavigation/pagenavigation.php index a6003894848b0..d9fb8ebf627a8 100644 --- a/plugins/content/pagenavigation/pagenavigation.php +++ b/plugins/content/pagenavigation/pagenavigation.php @@ -39,7 +39,7 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) return false; } - if (($context == 'com_content.article') && ($view == 'article') && $params->get('show_item_navigation')) + if (($context === 'com_content.article') && ($view === 'article') && $params->get('show_item_navigation')) { $db = JFactory::getDbo(); $user = JFactory::getUser(); @@ -70,7 +70,7 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) } // Additional check for invalid sort ordering. - if ($order_method == 'front') + if ($order_method === 'front') { $order_method = ''; } diff --git a/plugins/content/vote/vote.php b/plugins/content/vote/vote.php index 7f2ff9a165ceb..0d6902c084e1a 100644 --- a/plugins/content/vote/vote.php +++ b/plugins/content/vote/vote.php @@ -61,7 +61,7 @@ public function __construct(&$subject, $config) */ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) { - if ($this->votingPosition != 'top') + if ($this->votingPosition !== 'top') { return ''; } @@ -83,7 +83,7 @@ public function onContentBeforeDisplay($context, &$row, &$params, $page = 0) */ public function onContentAfterDisplay($context, &$row, &$params, $page = 0) { - if ($this->votingPosition != 'bottom') + if ($this->votingPosition !== 'bottom') { return ''; } @@ -107,7 +107,7 @@ private function displayVotingData($context, &$row, &$params, $page) { $parts = explode('.', $context); - if ($parts[0] != 'com_content') + if ($parts[0] !== 'com_content') { return false; } @@ -128,7 +128,7 @@ private function displayVotingData($context, &$row, &$params, $page) include $path; $html = ob_get_clean(); - if ($this->app->input->getString('view', '') == 'article' && $row->state == 1) + if ($this->app->input->getString('view', '') === 'article' && $row->state == 1) { // Get the path for the voting form layout file $path = JPluginHelper::getLayoutPath('content', 'vote', 'vote'); diff --git a/plugins/editors/tinymce/tinymce.php b/plugins/editors/tinymce/tinymce.php index ef2eff30b16bf..ea730258367a4 100644 --- a/plugins/editors/tinymce/tinymce.php +++ b/plugins/editors/tinymce/tinymce.php @@ -537,7 +537,7 @@ public function onDisplay($name, $content, $width, $height, $col, $row, $buttons } // Is Joomla installed in subdirectory - if (JUri::root(true) != '/') + if (JUri::root(true) !== '/') { $isSubDir = JUri::root(true); } @@ -702,7 +702,7 @@ private function tinyButtons($name, $excluded) $options = $button->get('options'); $icon = $button->get('name'); - if ($button->get('link') != '#') + if ($button->get('link') !== '#') { $href = JUri::base() . $button->get('link'); } @@ -836,11 +836,11 @@ protected static function getGlobalFilters() $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; @@ -876,13 +876,13 @@ protected static function getGlobalFilters() // 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) @@ -892,7 +892,7 @@ protected static function getGlobalFilters() $customListAttributes = array_merge($customListAttributes, $tempAttributes); } } - elseif ($filterType == 'WL') + elseif ($filterType === 'WL') { $whiteList = true; $whiteListTags = array_merge($whiteListTags, $tempTags); diff --git a/plugins/finder/categories/categories.php b/plugins/finder/categories/categories.php index 743b92ee4e919..90e8ea4081440 100644 --- a/plugins/finder/categories/categories.php +++ b/plugins/finder/categories/categories.php @@ -89,11 +89,11 @@ class PlgFinderCategories extends FinderIndexerAdapter */ public function onFinderDelete($context, $table) { - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { $id = $table->id; } - elseif ($context == 'com_finder.index') + elseif ($context === 'com_finder.index') { $id = $table->link_id; } @@ -123,7 +123,7 @@ public function onFinderDelete($context, $table) public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle categories here. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) @@ -161,7 +161,7 @@ public function onFinderAfterSave($context, $row, $isNew) public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle categories here. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Query the database for the old access level and the parent if the item isn't new. if (!$isNew) @@ -190,7 +190,7 @@ public function onFinderBeforeSave($context, $row, $isNew) public function onFinderChangeState($context, $pks, $value) { // We only want to handle categories here. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { /* * The category published state is tied to the parent category @@ -224,7 +224,7 @@ public function onFinderChangeState($context, $pks, $value) } // Handle when the plugin is disabled. - if ($context == 'com_plugins.plugin' && $value === 0) + if ($context === 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } diff --git a/plugins/finder/contacts/contacts.php b/plugins/finder/contacts/contacts.php index e11ab8e3fa4b1..7864bb7486b3d 100644 --- a/plugins/finder/contacts/contacts.php +++ b/plugins/finder/contacts/contacts.php @@ -92,7 +92,7 @@ class PlgFinderContacts extends FinderIndexerAdapter public function onFinderCategoryChangeState($extension, $pks, $value) { // Make sure we're handling com_contact categories - if ($extension == 'com_contact') + if ($extension === 'com_contact') { $this->categoryStateChange($pks, $value); } @@ -113,11 +113,11 @@ public function onFinderCategoryChangeState($extension, $pks, $value) */ public function onFinderAfterDelete($context, $table) { - if ($context == 'com_contact.contact') + if ($context === 'com_contact.contact') { $id = $table->id; } - elseif ($context == 'com_finder.index') + elseif ($context === 'com_finder.index') { $id = $table->link_id; } @@ -144,7 +144,7 @@ public function onFinderAfterDelete($context, $table) public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle contacts here - if ($context == 'com_contact.contact') + if ($context === 'com_contact.contact') { // Check if the access levels are different if (!$isNew && $this->old_access != $row->access) @@ -158,7 +158,7 @@ public function onFinderAfterSave($context, $row, $isNew) } // Check for access changes in the category - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Check if the access levels are different if (!$isNew && $this->old_cataccess != $row->access) @@ -187,7 +187,7 @@ public function onFinderAfterSave($context, $row, $isNew) public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle contacts here - if ($context == 'com_contact.contact') + if ($context === 'com_contact.contact') { // Query the database for the old access level if the item isn't new if (!$isNew) @@ -197,7 +197,7 @@ public function onFinderBeforeSave($context, $row, $isNew) } // Check for access levels from the category - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Query the database for the old access level if the item isn't new if (!$isNew) @@ -225,13 +225,13 @@ public function onFinderBeforeSave($context, $row, $isNew) public function onFinderChangeState($context, $pks, $value) { // We only want to handle contacts here - if ($context == 'com_contact.contact') + if ($context === 'com_contact.contact') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled - if ($context == 'com_plugins.plugin' && $value === 0) + if ($context === 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } diff --git a/plugins/finder/content/content.php b/plugins/finder/content/content.php index 5b6dcfd041fe2..80ccda04ed7af 100644 --- a/plugins/finder/content/content.php +++ b/plugins/finder/content/content.php @@ -84,7 +84,7 @@ class PlgFinderContent extends FinderIndexerAdapter public function onFinderCategoryChangeState($extension, $pks, $value) { // Make sure we're handling com_content categories. - if ($extension == 'com_content') + if ($extension === 'com_content') { $this->categoryStateChange($pks, $value); } @@ -103,11 +103,11 @@ public function onFinderCategoryChangeState($extension, $pks, $value) */ public function onFinderAfterDelete($context, $table) { - if ($context == 'com_content.article') + if ($context === 'com_content.article') { $id = $table->id; } - elseif ($context == 'com_finder.index') + elseif ($context === 'com_finder.index') { $id = $table->link_id; } @@ -138,7 +138,7 @@ public function onFinderAfterDelete($context, $table) public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle articles here. - if ($context == 'com_content.article' || $context == 'com_content.form') + if ($context === 'com_content.article' || $context === 'com_content.form') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) @@ -152,7 +152,7 @@ public function onFinderAfterSave($context, $row, $isNew) } // Check for access changes in the category. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_cataccess != $row->access) @@ -180,7 +180,7 @@ public function onFinderAfterSave($context, $row, $isNew) public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle articles here. - if ($context == 'com_content.article' || $context == 'com_content.form') + if ($context === 'com_content.article' || $context === 'com_content.form') { // Query the database for the old access level if the item isn't new. if (!$isNew) @@ -190,7 +190,7 @@ public function onFinderBeforeSave($context, $row, $isNew) } // Check for access levels from the category. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Query the database for the old access level if the item isn't new. if (!$isNew) @@ -218,13 +218,13 @@ public function onFinderBeforeSave($context, $row, $isNew) public function onFinderChangeState($context, $pks, $value) { // We only want to handle articles here. - if ($context == 'com_content.article' || $context == 'com_content.form') + if ($context === 'com_content.article' || $context === 'com_content.form') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled. - if ($context == 'com_plugins.plugin' && $value === 0) + if ($context === 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } diff --git a/plugins/finder/newsfeeds/newsfeeds.php b/plugins/finder/newsfeeds/newsfeeds.php index 4f40e152a0332..344c8afa4673f 100644 --- a/plugins/finder/newsfeeds/newsfeeds.php +++ b/plugins/finder/newsfeeds/newsfeeds.php @@ -92,7 +92,7 @@ class PlgFinderNewsfeeds extends FinderIndexerAdapter public function onFinderCategoryChangeState($extension, $pks, $value) { // Make sure we're handling com_newsfeeds categories. - if ($extension == 'com_newsfeeds') + if ($extension === 'com_newsfeeds') { $this->categoryStateChange($pks, $value); } @@ -111,11 +111,11 @@ public function onFinderCategoryChangeState($extension, $pks, $value) */ public function onFinderAfterDelete($context, $table) { - if ($context == 'com_newsfeeds.newsfeed') + if ($context === 'com_newsfeeds.newsfeed') { $id = $table->id; } - elseif ($context == 'com_finder.index') + elseif ($context === 'com_finder.index') { $id = $table->link_id; } @@ -146,7 +146,7 @@ public function onFinderAfterDelete($context, $table) public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle newsfeeds here. - if ($context == 'com_newsfeeds.newsfeed') + if ($context === 'com_newsfeeds.newsfeed') { // Check if the access levels are different. if (!$isNew && $this->old_access != $row->access) @@ -160,7 +160,7 @@ public function onFinderAfterSave($context, $row, $isNew) } // Check for access changes in the category. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Check if the access levels are different. if (!$isNew && $this->old_cataccess != $row->access) @@ -188,7 +188,7 @@ public function onFinderAfterSave($context, $row, $isNew) public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle newsfeeds here. - if ($context == 'com_newsfeeds.newsfeed') + if ($context === 'com_newsfeeds.newsfeed') { // Query the database for the old access level if the item isn't new. if (!$isNew) @@ -198,7 +198,7 @@ public function onFinderBeforeSave($context, $row, $isNew) } // Check for access levels from the category. - if ($context == 'com_categories.category') + if ($context === 'com_categories.category') { // Query the database for the old access level if the item isn't new. if (!$isNew) @@ -226,13 +226,13 @@ public function onFinderBeforeSave($context, $row, $isNew) public function onFinderChangeState($context, $pks, $value) { // We only want to handle newsfeeds here. - if ($context == 'com_newsfeeds.newsfeed') + if ($context === 'com_newsfeeds.newsfeed') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled. - if ($context == 'com_plugins.plugin' && $value === 0) + if ($context === 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } diff --git a/plugins/finder/tags/tags.php b/plugins/finder/tags/tags.php index f118e3d7dacfa..ed8bf4975f60c 100644 --- a/plugins/finder/tags/tags.php +++ b/plugins/finder/tags/tags.php @@ -89,11 +89,11 @@ class PlgFinderTags extends FinderIndexerAdapter */ public function onFinderAfterDelete($context, $table) { - if ($context == 'com_tags.tag') + if ($context === 'com_tags.tag') { $id = $table->id; } - elseif ($context == 'com_finder.index') + elseif ($context === 'com_finder.index') { $id = $table->link_id; } @@ -120,7 +120,7 @@ public function onFinderAfterDelete($context, $table) public function onFinderAfterSave($context, $row, $isNew) { // We only want to handle tags here. - if ($context == 'com_tags.tag') + if ($context === 'com_tags.tag') { // Check if the access levels are different if (!$isNew && $this->old_access != $row->access) @@ -153,7 +153,7 @@ public function onFinderAfterSave($context, $row, $isNew) public function onFinderBeforeSave($context, $row, $isNew) { // We only want to handle news feeds here - if ($context == 'com_tags.tag') + if ($context === 'com_tags.tag') { // Query the database for the old access level if the item isn't new if (!$isNew) @@ -181,12 +181,12 @@ public function onFinderBeforeSave($context, $row, $isNew) public function onFinderChangeState($context, $pks, $value) { // We only want to handle tags here - if ($context == 'com_tags.tag') + if ($context === 'com_tags.tag') { $this->itemStateChange($pks, $value); } // Handle when the plugin is disabled - if ($context == 'com_plugins.plugin' && $value === 0) + if ($context === 'com_plugins.plugin' && $value === 0) { $this->pluginDisable($pks); } diff --git a/plugins/quickicon/phpversioncheck/phpversioncheck.php b/plugins/quickicon/phpversioncheck/phpversioncheck.php index 0f3d2d669aa5f..f34c3f8030ddb 100644 --- a/plugins/quickicon/phpversioncheck/phpversioncheck.php +++ b/plugins/quickicon/phpversioncheck/phpversioncheck.php @@ -224,7 +224,7 @@ private function shouldDisplayMessage() } // Only to com_cpanel - if ($this->app->input->get('option') != 'com_cpanel') + if ($this->app->input->get('option') !== 'com_cpanel') { return false; } diff --git a/plugins/search/content/content.php b/plugins/search/content/content.php index ad0b43ea4114c..0801b5835afbf 100644 --- a/plugins/search/content/content.php +++ b/plugins/search/content/content.php @@ -115,7 +115,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu $wheres[] = implode(' OR ', $wheres2); } - $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; + $where = '(' . implode(($phrase === 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } diff --git a/plugins/search/newsfeeds/newsfeeds.php b/plugins/search/newsfeeds/newsfeeds.php index dbaa2327591bf..e3608263dbd9c 100644 --- a/plugins/search/newsfeeds/newsfeeds.php +++ b/plugins/search/newsfeeds/newsfeeds.php @@ -122,7 +122,7 @@ public function onContentSearch($text, $phrase = '', $ordering = '', $areas = nu $wheres[] = implode(' OR ', $wheres2); } - $where = '(' . implode(($phrase == 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; + $where = '(' . implode(($phrase === 'all' ? ') AND (' : ') OR ('), $wheres) . ')'; break; } diff --git a/plugins/system/cache/cache.php b/plugins/system/cache/cache.php index c3064e5841e5d..397a8dcb2d659 100644 --- a/plugins/system/cache/cache.php +++ b/plugins/system/cache/cache.php @@ -65,7 +65,7 @@ public function onAfterInitialise() return; } - if ($user->get('guest') && $app->input->getMethod() == 'GET') + if ($user->get('guest') && $app->input->getMethod() === 'GET') { $this->_cache->setCaching(true); } diff --git a/plugins/system/debug/debug.php b/plugins/system/debug/debug.php index 5ea6d3a254690..c2b349328e75f 100644 --- a/plugins/system/debug/debug.php +++ b/plugins/system/debug/debug.php @@ -242,7 +242,7 @@ public function onAfterRespond() // No debug for Safari and Chrome redirection. if (strstr(strtolower(isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''), 'webkit') !== false - && substr($contents, 0, 50) == '' . htmlspecialchars($td); $hasWarnings = true; } - elseif ($k == 'key') + elseif ($k === 'key') { if ($td === 'NULL') { @@ -1409,7 +1409,7 @@ protected function tableToHtml($table, &$hasWarnings) $html[] = '' . htmlspecialchars($td) . ''; } } - elseif ($k == 'Extra') + elseif ($k === 'Extra') { $htmlTd = htmlspecialchars($td); @@ -1865,7 +1865,7 @@ protected function displayLogs() array_filter( $this->logEntries, function($logEntry) { - return $logEntry->category == 'databasequery'; + return $logEntry->category === 'databasequery'; } ) ); @@ -1877,7 +1877,7 @@ protected function displayLogs() array_filter( $this->logEntries, function($logEntry) { - return $logEntry->category == 'deprecated'; + return $logEntry->category === 'deprecated'; } ) ); diff --git a/plugins/system/fields/fields.php b/plugins/system/fields/fields.php index 700d965462dda..14f3468904088 100644 --- a/plugins/system/fields/fields.php +++ b/plugins/system/fields/fields.php @@ -503,7 +503,7 @@ public function onPrepareFinderContent($item) } // Transofrm com_article to com_content - if ($component == 'com_article') + if ($component === 'com_article') { $component = 'com_content'; } @@ -567,7 +567,7 @@ private function getParts($context) return null; } - if ($parts[1] == 'form') + if ($parts[1] === 'form') { // The context is not from a known one, we need to do a lookup // @todo use the api here. diff --git a/plugins/system/languagecode/languagecode.php b/plugins/system/languagecode/languagecode.php index 16f640259e961..042db1a306991 100644 --- a/plugins/system/languagecode/languagecode.php +++ b/plugins/system/languagecode/languagecode.php @@ -124,7 +124,7 @@ public function onContentPrepareForm($form, $data) } // Check we are manipulating the languagecode plugin. - if ($form->getName() != 'com_plugins.plugin' || !$form->getField('languagecodeplugin', 'params')) + if ($form->getName() !== 'com_plugins.plugin' || !$form->getField('languagecodeplugin', 'params')) { return true; } diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php index 61b2836b5c484..05bbc92a9b4af 100644 --- a/plugins/system/languagefilter/languagefilter.php +++ b/plugins/system/languagefilter/languagefilter.php @@ -375,7 +375,7 @@ public function parseRule(&$router, &$uri) // We are called via POST. We don't care about the language // and simply set the default language as our current language. - if ($this->app->input->getMethod() == 'POST' + if ($this->app->input->getMethod() === 'POST' || count($this->app->input->post) > 0 || count($this->app->input->files) > 0) { @@ -663,7 +663,7 @@ public function onUserLogin($user, $options = array()) // We are on a Home page, we redirect to the user preferred site language Home page. $item = $menu->getDefault($lang_code); - if ($item && $item->language != $active->language && $item->language != '*') + if ($item && $item->language != $active->language && $item->language !== '*') { $this->app->setUserState('users.login.form.return', 'index.php?Itemid=' . $item->id); $foundAssociation = true; @@ -704,7 +704,7 @@ public function onAfterDispatch() { $doc = JFactory::getDocument(); - if ($this->app->isSite() && $this->params->get('alternate_meta', 1) && $doc->getType() == 'html') + if ($this->app->isSite() && $this->params->get('alternate_meta', 1) && $doc->getType() === 'html') { $languages = $this->lang_codes; $homes = JLanguageMultilang::getSiteHomePages(); @@ -801,7 +801,7 @@ public function onAfterDispatch() if ($this->params->get('xdefault', 1)) { $xdefault_language = $this->params->get('xdefault_language', $this->default_lang); - $xdefault_language = ( $xdefault_language == 'default' ) ? $this->default_lang : $xdefault_language; + $xdefault_language = ($xdefault_language === 'default') ? $this->default_lang : $xdefault_language; if (isset($languages[$xdefault_language])) { diff --git a/plugins/system/stats/stats.php b/plugins/system/stats/stats.php index de69c8b8a15f9..ef93d3f0e6db7 100644 --- a/plugins/system/stats/stats.php +++ b/plugins/system/stats/stats.php @@ -402,7 +402,7 @@ private function isUpdateRequired() */ private function isAjaxRequest() { - return strtolower($this->app->input->server->get('HTTP_X_REQUESTED_WITH', '')) == 'xmlhttprequest'; + return strtolower($this->app->input->server->get('HTTP_X_REQUESTED_WITH', '')) === 'xmlhttprequest'; } /** diff --git a/plugins/system/updatenotification/updatenotification.php b/plugins/system/updatenotification/updatenotification.php index d7312c70f5194..05f01752e180d 100644 --- a/plugins/system/updatenotification/updatenotification.php +++ b/plugins/system/updatenotification/updatenotification.php @@ -154,7 +154,7 @@ public function onAfterRender() // If we're here, we have updates. First, get a link to the Joomla! Update component. $baseURL = JUri::base(); $baseURL = rtrim($baseURL, '/'); - $baseURL .= (substr($baseURL, -13) != 'administrator') ? '/administrator/' : '/'; + $baseURL .= (substr($baseURL, -13) !== 'administrator') ? '/administrator/' : '/'; $baseURL .= 'index.php?option=com_joomlaupdate'; $uri = new JUri($baseURL); diff --git a/plugins/twofactorauth/totp/totp.php b/plugins/twofactorauth/totp/totp.php index b476c42dde103..f90fcfe276e95 100644 --- a/plugins/twofactorauth/totp/totp.php +++ b/plugins/twofactorauth/totp/totp.php @@ -110,7 +110,7 @@ public function onUserTwofactorShowConfiguration($otpConfig, $user_id = null) $url = $totp->getUrl($username, $hostname, $secret); // Is this a new TOTP setup? If so, we'll have to show the code validation field. - $new_totp = $otpConfig->method != 'totp'; + $new_totp = $otpConfig->method !== 'totp'; // Start output buffering @ob_start(); diff --git a/plugins/twofactorauth/yubikey/yubikey.php b/plugins/twofactorauth/yubikey/yubikey.php index c991b31e61b05..db7de6b5da51b 100644 --- a/plugins/twofactorauth/yubikey/yubikey.php +++ b/plugins/twofactorauth/yubikey/yubikey.php @@ -343,7 +343,7 @@ public function validateYubikeyOtp($otp) } // Validate the response - We need an OK message reply - if ($data['status'] != 'OK') + if ($data['status'] !== 'OK') { return false; } diff --git a/plugins/user/profile/field/dob.php b/plugins/user/profile/field/dob.php index 4761a52d7beda..e3e0d8e4a0c8f 100644 --- a/plugins/user/profile/field/dob.php +++ b/plugins/user/profile/field/dob.php @@ -50,7 +50,7 @@ protected function getLabel() $view = $app->input->getString('view', ''); // Only display the tip when editing profile - if ($app->isAdmin() || $view == 'profile' || $view == 'registration') + if ($app->isAdmin() || $view === 'profile' || $view === 'registration') { $layout = new JLayoutFile('plugins.user.profile.fields.dob'); $info = $layout->render(array('text' => $text)); diff --git a/plugins/user/profile/profile.php b/plugins/user/profile/profile.php index c02b176ef5e5a..9332e13d582f3 100644 --- a/plugins/user/profile/profile.php +++ b/plugins/user/profile/profile.php @@ -148,7 +148,7 @@ public static function url($value) // Convert website url to utf8 for display $value = JStringPunycode::urlToUTF8(htmlspecialchars($value)); - if (substr($value, 0, 4) == 'http') + if (substr($value, 0, 4) === 'http') { return '' . $value . ''; } @@ -263,7 +263,7 @@ public function onContentPrepareForm($form, $data) // Change fields description when displayed in frontend or backend profile editing $app = JFactory::getApplication(); - if ($app->isSite() || $name == 'com_users.user' || $name == 'com_admin.profile') + if ($app->isSite() || $name === 'com_users.user' || $name === 'com_admin.profile') { $form->setFieldAttribute('address1', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); $form->setFieldAttribute('address2', 'description', 'PLG_USER_PROFILE_FILL_FIELD_DESC_SITE', 'profile'); @@ -283,7 +283,7 @@ public function onContentPrepareForm($form, $data) $tosenabled = $this->params->get('register-require_tos', 0); // We need to be in the registration form and field needs to be enabled - if ($name != 'com_users.registration' || !$tosenabled) + if ($name !== 'com_users.registration' || !$tosenabled) { // We only want the TOS in the registration form $form->removeField('tos', 'profile'); @@ -297,7 +297,7 @@ public function onContentPrepareForm($form, $data) foreach ($fields as $field) { // Case using the users manager in admin - if ($name == 'com_users.user') + if ($name === 'com_users.user') { // Remove the field if it is disabled in registration and profile if ($this->params->get('register-require_' . $field, 1) == 0 @@ -307,7 +307,7 @@ public function onContentPrepareForm($form, $data) } } // Case registration - elseif ($name == 'com_users.registration') + elseif ($name === 'com_users.registration') { // Toggle whether the field is required. if ($this->params->get('register-require_' . $field, 1) > 0) @@ -320,7 +320,7 @@ public function onContentPrepareForm($form, $data) } } // Case profile in site or admin - elseif ($name == 'com_users.profile' || $name == 'com_admin.profile') + elseif ($name === 'com_users.profile' || $name === 'com_admin.profile') { // Toggle whether the field is required. if ($this->params->get('profile-require_' . $field, 1) > 0) @@ -376,7 +376,7 @@ public function onUserBeforeSave($user, $isnew, $data) $tosarticle = $this->params->get('register_tos_article'); $tosenabled = ($this->params->get('register-require_tos', 0) == 2); - if (($task == 'register') && $tosenabled && $tosarticle && ($option == 'com_users')) + if (($task === 'register') && $tosenabled && $tosarticle && ($option === 'com_users')) { // Check that the tos is checked. if (!$data['profile']['tos'])