1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 08:47:45 +02:00

[task/functional] Allow tests to bypass certain restrictions with DEBUG_TEST

PHPBB3-10758
This commit is contained in:
David King
2012-09-01 10:35:46 -04:00
parent 7cffebbd49
commit 7dfe26dd78
3 changed files with 6 additions and 11 deletions

View File

@@ -2811,7 +2811,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
$diff = time() - $creation_time;
// If creation_time and the time() now is zero we can assume it was not a human doing this (the check for if ($diff)...
if ($diff && ($diff <= $timespan || $timespan === -1))
if (defined('DEBUG_TEST') || $diff && ($diff <= $timespan || $timespan === -1))
{
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
$key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid);