aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-09-09 19:46:27 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-09-09 19:46:27 +0200
commit047728e3d415c439f77beb1d0166d56b6120cac8 (patch)
treed21a75c8be0d6fac05515f20223aced49eed1fdc
parent12398d65fd52b1cec93d5aaccf933a9ba3eb93a0 (diff)
downloadforums-047728e3d415c439f77beb1d0166d56b6120cac8.tar
forums-047728e3d415c439f77beb1d0166d56b6120cac8.tar.gz
forums-047728e3d415c439f77beb1d0166d56b6120cac8.tar.bz2
forums-047728e3d415c439f77beb1d0166d56b6120cac8.tar.xz
forums-047728e3d415c439f77beb1d0166d56b6120cac8.zip
[ticket/13052] Remove additional parameter from check_form_key()
PHPBB3-13052
-rw-r--r--phpBB/includes/functions.php26
1 files changed, 9 insertions, 17 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index df613682a7..f7ee2c44ab 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2576,21 +2576,18 @@ function add_form_key($form_name)
}
/**
-* Check the form key. Required for all altering actions not secured by confirm_box
-* @param string $form_name The name of the form; has to match the name used in add_form_key, otherwise no restrictions apply
-* @param int $timespan The maximum acceptable age for a submitted form in seconds. Defaults to the config setting.
-* @param string $return_page The address for the return link
-* @param bool $trigger If true, the function will triger an error when encountering an invalid form
-*/
-function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false)
+ * Check the form key. Required for all altering actions not secured by confirm_box
+ *
+ * @param string $form_name The name of the form; has to match the name used
+ * in add_form_key, otherwise no restrictions apply
+ * @return bool True, if the form key was valid, false otherwise
+ */
+function check_form_key($form_name)
{
global $config, $user;
- if ($timespan === false)
- {
- // we enforce a minimum value of half a minute here.
- $timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);
- }
+ // we enforce a minimum value of half a minute here.
+ $timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']);
if (isset($_POST['creation_time']) && isset($_POST['form_token']))
{
@@ -2612,11 +2609,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
}
}
- if ($trigger)
- {
- trigger_error($user->lang['FORM_INVALID'] . $return_page);
- }
-
return false;
}