Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[plg_system] Manifest file filters #20456

Merged
merged 2 commits into from
May 24, 2018
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
4 changes: 2 additions & 2 deletions plugins/system/cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/system/cache/cache.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
description="PLG_CACHE_FIELD_BROWSERCACHE_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -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"
/>

</fieldset>
Expand All @@ -50,7 +51,6 @@
class="input-xxlarge"
rows="15"
filter="raw"
default=""
/>

</fieldset>
Expand Down
12 changes: 6 additions & 6 deletions plugins/system/debug/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -772,7 +772,7 @@ protected function displayProfileInformation()
sprintf('<span class="label ' . $labelClass . '">%.2f&nbsp;ms</span>', $totalQueryTime)
) . '</div>';

if ($this->params->get('log-executed-sql', '0'))
if ($this->params->get('log-executed-sql', 0))
{
$this->writeToFile();
}
Expand Down Expand Up @@ -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');

Expand Down
17 changes: 16 additions & 1 deletion plugins/system/debug/debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>

Expand All @@ -35,6 +36,7 @@
description="PLG_DEBUG_FIELD_SESSION_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -47,6 +49,7 @@
description="PLG_DEBUG_FIELD_PROFILING_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -59,6 +62,7 @@
description="PLG_DEBUG_FIELD_QUERIES_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -71,6 +75,7 @@
description="PLG_DEBUG_FIELD_QUERY_TYPES_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -83,6 +88,7 @@
description="PLG_DEBUG_FIELD_MEMORY_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -95,6 +101,7 @@
description="PLG_DEBUG_FIELD_LOGS_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand Down Expand Up @@ -125,7 +132,6 @@
label="PLG_DEBUG_FIELD_LOG_CATEGORIES_LABEL"
description="PLG_DEBUG_FIELD_LOG_CATEGORIES_DESC"
size="60"
default=""
/>

<field
Expand All @@ -134,6 +140,7 @@
label="PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_LABEL"
description="PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_DESC"
default="0"
filter="integer"
class="btn-group btn-group-yesno btn-group-reversed"
>
<option value="0">PLG_DEBUG_FIELD_LOG_CATEGORY_MODE_INCLUDE</option>
Expand All @@ -147,6 +154,7 @@
description="PLG_DEBUG_FIELD_REFRESH_ASSETS_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -165,6 +173,7 @@
description="PLG_DEBUG_FIELD_LANGUAGE_ERRORFILES_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -177,6 +186,7 @@
description="PLG_DEBUG_FIELD_LANGUAGE_FILES_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -189,6 +199,7 @@
description="PLG_DEBUG_FIELD_LANGUAGE_STRING_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -201,6 +212,7 @@
description="PLG_DEBUG_FIELD_STRIP_FIRST_DESC"
class="btn-group btn-group-yesno"
default="1"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand Down Expand Up @@ -236,6 +248,7 @@
description="PLG_DEBUG_FIELD_LOG_DEPRECATED_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -248,6 +261,7 @@
description="PLG_DEBUG_FIELD_LOG_EVERYTHING_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand All @@ -260,6 +274,7 @@
description="PLG_DEBUG_FIELD_EXECUTEDSQL_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand Down
4 changes: 2 additions & 2 deletions plugins/system/languagefilter/languagefilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
7 changes: 7 additions & 0 deletions plugins/system/languagefilter/languagefilter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_LABEL"
description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_DETECT_BROWSER_DESC"
default="0"
filter="integer"
>
<option value="0">PLG_SYSTEM_LANGUAGEFILTER_SITE_LANGUAGE</option>
<option value="1">PLG_SYSTEM_LANGUAGEFILTER_BROWSER_SETTINGS</option>
Expand All @@ -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"
>
<option value="1">JYES</option>
Expand All @@ -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"
>
<option value="1">JYES</option>
Expand All @@ -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"
>
<option value="1">JYES</option>
Expand All @@ -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"
>
Expand All @@ -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"
>
<option value="1">JYES</option>
Expand All @@ -108,6 +114,7 @@
label="PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_LABEL"
description="PLG_SYSTEM_LANGUAGEFILTER_FIELD_COOKIE_DESC"
default="0"
filter="integer"
>
<option value="1">PLG_SYSTEM_LANGUAGEFILTER_OPTION_YEAR</option>
<option value="0">PLG_SYSTEM_LANGUAGEFILTER_OPTION_SESSION</option>
Expand Down
1 change: 1 addition & 0 deletions plugins/system/log/log.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
description="PLG_SYSTEM_LOG_FIELD_LOG_USERNAME_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand Down
1 change: 1 addition & 0 deletions plugins/system/redirect/form/excludes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</fieldset>
</form>
2 changes: 1 addition & 1 deletion plugins/system/redirect/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 2 additions & 0 deletions plugins/system/redirect/redirect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
>
<option value="1">JENABLED</option>
Expand All @@ -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"
>
<option value="1">JYES</option>
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/sef/sef.php
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down