Skip to content

Commit 0024373

Browse files
committed
[ticket/17589] Check confirm id
When a login fails the qa captcha is reset and creates a new `confirm_id`. However, the `confirm_id` is never checked for changes causing the captcha to believe it's still solved and thus no need to generate a new captcha. This commit checks the known `confirm_id` against the `confirm_id` given by the user, marking the captcha solved accordingly. PHPBB-17589
1 parent 4542343 commit 0024373

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • phpBB/phpbb/captcha/plugins

phpBB/phpbb/captcha/plugins/qa.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ function check_answer()
573573
global $db, $request;
574574

575575
$answer = ($this->question_strict) ? $request->variable('qa_answer', '', true) : utf8_clean_string($request->variable('qa_answer', '', true));
576+
$confirm_id = $request->variable('qa_confirm_id', '');
576577

577578
$sql = 'SELECT answer_text
578579
FROM ' . $this->table_captcha_answers . '
@@ -583,7 +584,7 @@ function check_answer()
583584
{
584585
$solution = ($this->question_strict) ? $row['answer_text'] : utf8_clean_string($row['answer_text']);
585586

586-
if ($solution === $answer)
587+
if ($solution === $answer && $this->confirm_id === $confirm_id)
587588
{
588589
$this->solved = true;
589590

0 commit comments

Comments
 (0)