Navigation Menu

Skip to content

Commit

Permalink
Fixed issue #17610: Token does not get marked as used if invalid emai…
Browse files Browse the repository at this point in the history
…l address exists (#2083)
  • Loading branch information
gabrieljenik committed Oct 22, 2021
1 parent 8b86524 commit 5e64cec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/helpers/frontend_helper.php
Expand Up @@ -428,7 +428,9 @@ function submittokens($quotaexit = false)
}
$token->usesleft--;
}
$token->save();
// We need to specify the attributes we are updating because validation could fail on other (untouched) attributes,
// preventing the update (eg.: the participant could have an invalid email).
$token->save(true, ['completed', 'usesleft']);

if ($quotaexit == false) {
if ($token && trim(strip_tags($thissurvey['email_confirm'])) != "" && $thissurvey['sendconfirmation'] == "Y") {
Expand Down

0 comments on commit 5e64cec

Please sign in to comment.