diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-10-29 17:44:42 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-21 23:55:48 +0100 |
commit | 7f8c4d877a9d9d5837e1b3612b2678d024ca087b (patch) | |
tree | edf97fb54ff0555e766427f59fe181c60e159320 | |
parent | 2e2ab7b485f76ab4000b5d8c47c846ff44c10a33 (diff) | |
download | forums-7f8c4d877a9d9d5837e1b3612b2678d024ca087b.tar forums-7f8c4d877a9d9d5837e1b3612b2678d024ca087b.tar.gz forums-7f8c4d877a9d9d5837e1b3612b2678d024ca087b.tar.bz2 forums-7f8c4d877a9d9d5837e1b3612b2678d024ca087b.tar.xz forums-7f8c4d877a9d9d5837e1b3612b2678d024ca087b.zip |
[ticket/10744] Prevent installing styles with reserved names
PHPBB3-10744
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 7 | ||||
-rw-r--r-- | phpBB/language/en/acp/styles.php | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index af3fd7937c..330da0ff73 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -29,6 +29,7 @@ class acp_styles protected $styles_path; protected $styles_path_absolute = 'styles'; protected $default_style = 0; + protected $reserved_style_names = array('adm', 'admin', 'all'); protected $db; protected $user; @@ -164,6 +165,12 @@ class acp_styles $last_installed = false; foreach ($dirs as $dir) { + if (in_array($dir, $this->reserved_style_names)) + { + $messages[] = $this->user->lang('STYLE_NAME_RESERVED', htmlspecialchars($dir)); + continue; + } + $found = false; foreach ($styles as &$style) { diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 506d569d56..e6b05c8282 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -74,6 +74,7 @@ $lang = array_merge($lang, array( 'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list', 'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles', 'STYLE_NAME' => 'Style name', + 'STYLE_NAME_RESERVED' => 'Style "%s" can not be installed, because the name is reserved.', 'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.', 'STYLE_PATH' => 'Style path', 'STYLE_UNINSTALL' => 'Uninstall', |