diff --git a/plugins/system/cache/cache.php b/plugins/system/cache/cache.php index 53e53008ad142..a8671f349e9f3 100644 --- a/plugins/system/cache/cache.php +++ b/plugins/system/cache/cache.php @@ -55,7 +55,7 @@ public function __construct(& $subject, $config) // Set the language in the class. $options = array( 'defaultgroup' => 'page', - 'browsercache' => $this->params->get('browsercache', false), + 'browsercache' => $this->params->get('browsercache', 0), 'caching' => false, ); @@ -188,7 +188,7 @@ protected function isExcluded() // Get the current menu item $active = $this->app->getMenu()->getActive(); - if ($active && $active->id && in_array($active->id, (array) $exclusions, true)) + if ($active && $active->id && in_array((int) $active->id, (array) $exclusions)) { return true; } diff --git a/plugins/system/cache/cache.xml b/plugins/system/cache/cache.xml index 1552bdc6f93ef..5ffe5bf89442c 100644 --- a/plugins/system/cache/cache.xml +++ b/plugins/system/cache/cache.xml @@ -26,6 +26,7 @@ description="PLG_CACHE_FIELD_BROWSERCACHE_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -36,8 +37,8 @@ type="menuitem" label="PLG_CACHE_FIELD_EXCLUDE_MENU_ITEMS_LABEL" description="PLG_CACHE_FIELD_EXCLUDE_MENU_ITEMS_DESC" - default="" multiple="multiple" + filter="int_array" /> @@ -50,7 +51,6 @@ class="input-xxlarge" rows="15" filter="raw" - default="" /> diff --git a/plugins/system/debug/debug.php b/plugins/system/debug/debug.php index 9f46cb9b68688..e1989e945ae00 100644 --- a/plugins/system/debug/debug.php +++ b/plugins/system/debug/debug.php @@ -111,13 +111,13 @@ public function __construct(&$subject, $config) parent::__construct($subject, $config); // Log the deprecated API. - if ($this->params->get('log-deprecated')) + if ($this->params->get('log-deprecated', 0)) { JLog::addLogger(array('text_file' => 'deprecated.php'), JLog::ALL, array('deprecated')); } // Log everything (except deprecated APIs, these are logged separately with the option above). - if ($this->params->get('log-everything')) + if ($this->params->get('log-everything', 0)) { JLog::addLogger(array('text_file' => 'everything.php'), JLog::ALL, array('deprecated', 'databasequery'), true); } @@ -331,7 +331,7 @@ public function onAfterRespond() $html[] = $this->display('language_files_loaded'); } - if ($this->params->get('language_strings')) + if ($this->params->get('language_strings', 1)) { $html[] = $this->display('untranslated_strings'); } @@ -404,7 +404,7 @@ private function isAuthorisedDisplayDebug() } // If the user is not allowed to view the output then end here. - $filterGroups = (array) $this->params->get('filter_groups', null); + $filterGroups = (array) $this->params->get('filter_groups', array()); if (!empty($filterGroups)) { @@ -772,7 +772,7 @@ protected function displayProfileInformation() sprintf('%.2f ms', $totalQueryTime) ) . ''; - if ($this->params->get('log-executed-sql', '0')) + if ($this->params->get('log-executed-sql', 0)) { $this->writeToFile(); } @@ -1621,7 +1621,7 @@ protected function displayLanguageFilesLoaded() */ protected function displayUntranslatedStrings() { - $stripFirst = $this->params->get('strip-first'); + $stripFirst = $this->params->get('strip-first', 1); $stripPref = $this->params->get('strip-prefix'); $stripSuff = $this->params->get('strip-suffix'); diff --git a/plugins/system/debug/debug.xml b/plugins/system/debug/debug.xml index 232d4eaa59ed5..c557968897357 100644 --- a/plugins/system/debug/debug.xml +++ b/plugins/system/debug/debug.xml @@ -25,6 +25,7 @@ label="PLG_DEBUG_FIELD_ALLOWED_GROUPS_LABEL" description="PLG_DEBUG_FIELD_ALLOWED_GROUPS_DESC" multiple="true" + filter="int_array" size="10" /> @@ -35,6 +36,7 @@ description="PLG_DEBUG_FIELD_SESSION_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -47,6 +49,7 @@ description="PLG_DEBUG_FIELD_PROFILING_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -59,6 +62,7 @@ description="PLG_DEBUG_FIELD_QUERIES_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -71,6 +75,7 @@ description="PLG_DEBUG_FIELD_QUERY_TYPES_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -83,6 +88,7 @@ description="PLG_DEBUG_FIELD_MEMORY_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -95,6 +101,7 @@ description="PLG_DEBUG_FIELD_LOGS_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -125,7 +132,6 @@ label="PLG_DEBUG_FIELD_LOG_CATEGORIES_LABEL" description="PLG_DEBUG_FIELD_LOG_CATEGORIES_DESC" size="60" - default="" /> @@ -147,6 +154,7 @@ description="PLG_DEBUG_FIELD_REFRESH_ASSETS_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -165,6 +173,7 @@ description="PLG_DEBUG_FIELD_LANGUAGE_ERRORFILES_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -177,6 +186,7 @@ description="PLG_DEBUG_FIELD_LANGUAGE_FILES_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -189,6 +199,7 @@ description="PLG_DEBUG_FIELD_LANGUAGE_STRING_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -201,6 +212,7 @@ description="PLG_DEBUG_FIELD_STRIP_FIRST_DESC" class="btn-group btn-group-yesno" default="1" + filter="integer" > @@ -236,6 +248,7 @@ description="PLG_DEBUG_FIELD_LOG_DEPRECATED_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -248,6 +261,7 @@ description="PLG_DEBUG_FIELD_LOG_EVERYTHING_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > @@ -260,6 +274,7 @@ description="PLG_DEBUG_FIELD_EXECUTEDSQL_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/system/languagefilter/languagefilter.php b/plugins/system/languagefilter/languagefilter.php index 9d5bf41b7d003..2076cad1df514 100644 --- a/plugins/system/languagefilter/languagefilter.php +++ b/plugins/system/languagefilter/languagefilter.php @@ -519,7 +519,7 @@ public function parseRule(&$router, &$uri) */ public function onUserBeforeSave($user, $isnew, $new) { - if (array_key_exists('params', $user) && $this->params->get('automatic_change', '1') == '1') + if (array_key_exists('params', $user) && $this->params->get('automatic_change', 1) == 1) { $registry = new Registry($user['params']); $this->user_lang_code = $registry->get('language'); @@ -547,7 +547,7 @@ public function onUserBeforeSave($user, $isnew, $new) */ public function onUserAfterSave($user, $isnew, $success, $msg) { - if ($success && array_key_exists('params', $user) && $this->params->get('automatic_change', '1') == '1') + if ($success && array_key_exists('params', $user) && $this->params->get('automatic_change', 1) == 1) { $registry = new Registry($user['params']); $lang_code = $registry->get('language'); diff --git a/plugins/system/languagefilter/languagefilter.xml b/plugins/system/languagefilter/languagefilter.xml index 02c0564d42e9b..065b714812c42 100644 --- a/plugins/system/languagefilter/languagefilter.xml +++ b/plugins/system/languagefilter/languagefilter.xml @@ -25,6 +25,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_DESC" default="0" + filter="integer" > @@ -36,6 +37,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_AUTOMATIC_CHANGE_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > @@ -48,6 +50,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_ITEM_ASSOCIATIONS_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_ITEM_ASSOCIATIONS_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > @@ -60,6 +63,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_ALTERNATE_META_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > @@ -72,6 +76,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_XDEFAULT_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" showon="alternate_meta:1" > @@ -96,6 +101,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_REMOVE_DEFAULT_PREFIX_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_REMOVE_DEFAULT_PREFIX_DESC" default="0" + filter="integer" class="btn-group btn-group-yesno" > @@ -108,6 +114,7 @@ label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_LABEL" description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_DESC" default="0" + filter="integer" > diff --git a/plugins/system/log/log.xml b/plugins/system/log/log.xml index 9e0b1e5131b7a..b23e46e845779 100644 --- a/plugins/system/log/log.xml +++ b/plugins/system/log/log.xml @@ -26,6 +26,7 @@ description="PLG_SYSTEM_LOG_FIELD_LOG_USERNAME_DESC" class="btn-group btn-group-yesno" default="0" + filter="integer" > diff --git a/plugins/system/redirect/form/excludes.xml b/plugins/system/redirect/form/excludes.xml index 1e77e45afaaaf..3f4eae2ce9a7d 100644 --- a/plugins/system/redirect/form/excludes.xml +++ b/plugins/system/redirect/form/excludes.xml @@ -13,6 +13,7 @@ type="checkbox" label="PLG_SYSTEM_REDIRECT_FIELD_EXCLUDE_URLS_REGEXP_LABEL" description="PLG_SYSTEM_REDIRECT_FIELD_EXCLUDE_URLS_REGEXP_DESC" + filter="integer" /> diff --git a/plugins/system/redirect/redirect.php b/plugins/system/redirect/redirect.php index 3983bd9f40014..deebe6c2ed031 100644 --- a/plugins/system/redirect/redirect.php +++ b/plugins/system/redirect/redirect.php @@ -295,7 +295,7 @@ private static function doErrorHandling($error) { $params = new Registry(JPluginHelper::getPlugin('system', 'redirect')->params); - if ((bool) $params->get('collect_urls', true)) + if ((bool) $params->get('collect_urls', 1)) { if (!$params->get('includeUrl', 1)) { diff --git a/plugins/system/redirect/redirect.xml b/plugins/system/redirect/redirect.xml index 8e4c04a4fe8ce..6438fb1950aaf 100644 --- a/plugins/system/redirect/redirect.xml +++ b/plugins/system/redirect/redirect.xml @@ -26,6 +26,7 @@ label="PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_LABEL" description="PLG_SYSTEM_REDIRECT_FIELD_COLLECT_URLS_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > @@ -37,6 +38,7 @@ label="PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_LABEL" description="PLG_SYSTEM_REDIRECT_FIELD_STORE_FULL_URL_DESC" default="1" + filter="integer" class="btn-group btn-group-yesno" > diff --git a/plugins/system/sef/sef.php b/plugins/system/sef/sef.php index e68993b55876e..dfe2eedafd10e 100644 --- a/plugins/system/sef/sef.php +++ b/plugins/system/sef/sef.php @@ -40,7 +40,7 @@ public function onAfterDispatch() return; } - $sefDomain = $this->params->get('domain', ''); + $sefDomain = $this->params->get('domain', false); // Don't add a canonical html tag if no alternative domain has added in SEF plugin domain field. if (empty($sefDomain))