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[] = '