mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
git-svn-id: file:///svn/phpbb/trunk@8160 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ab27966a60
commit
2bbaf1218e
1 changed files with 4 additions and 4 deletions
|
@ -2028,7 +2028,7 @@ function add_form_key($form_name)
|
||||||
* @param bool $trigger If true, the function will triger an error when encountering an invalid form
|
* @param bool $trigger If true, the function will triger an error when encountering an invalid form
|
||||||
* @param int $minimum_time The minimum acceptable age for a submitted form in seconds
|
* @param int $minimum_time The minimum acceptable age for a submitted form in seconds
|
||||||
*/
|
*/
|
||||||
function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false, $miniumum_time = false)
|
function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false, $minimum_time = false)
|
||||||
{
|
{
|
||||||
global $config, $user;
|
global $config, $user;
|
||||||
|
|
||||||
|
@ -2036,9 +2036,9 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
|
||||||
{
|
{
|
||||||
$timespan = $config['form_token_lifetime'];
|
$timespan = $config['form_token_lifetime'];
|
||||||
}
|
}
|
||||||
if ($miniumum_time === false)
|
if ($minimum_time === false)
|
||||||
{
|
{
|
||||||
$miniumum_time = $config['form_token_mintime'];
|
$minimum_time = $config['form_token_mintime'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_POST['creation_time']) && isset($_POST['form_token']))
|
if (isset($_POST['creation_time']) && isset($_POST['form_token']))
|
||||||
|
@ -2048,7 +2048,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
|
||||||
|
|
||||||
$diff = (time() - $creation_time);
|
$diff = (time() - $creation_time);
|
||||||
|
|
||||||
if (($diff >= $miniumum_time) && (($diff <= $timespan) || $timespan == -1))
|
if (($diff >= $minimum_time) && (($diff <= $timespan) || $timespan == -1))
|
||||||
{
|
{
|
||||||
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
|
$token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : '';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue