Skip to content

Commit

Permalink
fix missing token after form fail (#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coutadeur authored and davidcoutadeur committed Jan 13, 2025
1 parent f37bd74 commit 00648c4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions htdocs/sendtoken.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@
# Check tokenform
#==============================================================================

$check_tokenform = false;
if ( !$result ) {
$formtoken = strval($_REQUEST["formtoken"]);
$result = $sspCache->verify_form_token($formtoken);
$check_tokenform = true;
}

#==============================================================================
Expand Down Expand Up @@ -164,11 +162,11 @@

#==============================================================================
# if:
# * form token has been checked previously (and thus erased) and
# * this is not the first time we load this form (not emptysendtokenform), and
# * something bad happened (bad captcha,...)
# regenerate a form token
#==============================================================================
if( $check_tokenform && $result != "" )
if( $result != "emptysendtokenform" && $result != "" )
{
$formtoken = $sspCache->generate_form_token($cache_form_expiration);
}
Expand Down

0 comments on commit 00648c4

Please sign in to comment.