Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-13522

Q&A Captcha ACP, admins can add blank answers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.1.4-RC1
    • 3.0.12, 3.1.2
    • ACP
    • None

      When an admin leaves a blank line between two answers, a blank "answer" is added. (And accepted as answer for solving this captcha, which means you can leave the entire Q&A captcha field empty)

      While this is quite obvious behaviour (you also see the blank line when editing the question), I think it should not be possible to add blank answers in the first place.

      This is the line where the answers are converted to an array: https://github.com/phpbb/phpbb/blob/develop/phpBB/phpbb/captcha/plugins/qa.php#L834
      I suggest after calling explode() to first call the function array_map('trim') and then array_filter().

      (I did the same for my custom captcha)

            Marc Marc
            Derky Derky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: