aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorCesar G <prototech91@gmail.com>2014-10-22 14:31:19 -0700
committerCesar G <prototech91@gmail.com>2014-10-22 15:46:00 -0700
commit4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46 (patch)
tree3f88a45f236309b443d7c41e78ea988c14a78e6c /phpBB/includes/acp
parent8442f2239db16953585b46ffca5e944d66750c8b (diff)
downloadforums-4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46.tar
forums-4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46.tar.gz
forums-4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46.tar.bz2
forums-4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46.tar.xz
forums-4d30633cd4dfa8ad8438fc63c7cefe3c66e5ad46.zip
[ticket/security-161] Add form token to styles management form.
SECURITY-161
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_styles.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 3f9d21f56c..3f40696309 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -69,11 +69,6 @@ class acp_styles
$action = $this->request->variable('action', '');
$post_actions = array('install', 'activate', 'deactivate', 'uninstall');
- if ($action && in_array($action, $post_actions) && !check_link_hash($request->variable('hash', ''), $action))
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
foreach ($post_actions as $key)
{
if ($this->request->is_set_post($key))
@@ -82,6 +77,18 @@ class acp_styles
}
}
+ // The uninstall action uses confirm_box() to verify the validity of the request,
+ // so there is no need to check for a valid token here.
+ if (in_array($action, $post_actions) && $action != 'uninstall')
+ {
+ $is_valid_request = check_link_hash($request->variable('hash', ''), $action) || check_form_key('styles_management');
+
+ if (!$is_valid_request)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+ }
+
if ($action != '')
{
$this->s_hidden_fields['action'] = $action;
@@ -121,6 +128,8 @@ class acp_styles
*/
protected function frontend()
{
+ add_form_key('styles_management');
+
// Check mode
switch ($this->mode)
{