aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_database.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2016-09-30 22:32:54 +0100
committerMarc Alexander <admin@m-a-styles.de>2016-09-30 22:32:54 +0100
commit88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c (patch)
treedac3bc6f55327ceef850b3051f87e00fbd6db175 /phpBB/includes/acp/acp_database.php
parent2fd2fb94cf4577b9a48c9d87cd0c14c852667a9f (diff)
downloadforums-88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c.tar
forums-88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c.tar.gz
forums-88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c.tar.bz2
forums-88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c.tar.xz
forums-88d7c4fe57eb0255c6c5cb434f3a3aaa0f6e726c.zip
[ticket/14789] Move form key checks to where they actually do something
PHPBB3-14789
Diffstat (limited to 'phpBB/includes/acp/acp_database.php')
-rw-r--r--phpBB/includes/acp/acp_database.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 16655ff4cb..a54ba76358 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -42,11 +42,6 @@ class acp_database
$form_key = 'acp_database';
add_form_key($form_key);
- if ($submit && !check_form_key($form_key))
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
$template->assign_vars(array(
'MODE' => $mode
));
@@ -70,6 +65,11 @@ class acp_database
trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
$store = $download = $structure = $schema_data = false;
if ($where == 'store_and_download' || $where == 'store')
@@ -233,6 +233,11 @@ class acp_database
$file = request_var('file', '');
$download = request_var('download', '');
+ if (!check_form_key($form_key))
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+
if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
trigger_error($user->lang['BACKUP_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);