Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-13521

Q&A Captcha ACP, required fields error corrupts inputted data

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 3.0.12, 3.1.2
    • 3.1.9-RC1
    • ACP
    • None

    Description

      When editing an existing Q&A question and triggering the "Required Fields"-error by leaving the question blank, the previous question is restored in the input field (while it should stay blank) but more concerning is that all the answers are replaced with the first char of the first answer. (See screenshots)

      The restored question in the input field is caused by this if-statement, while it should actually be using some isset() check like $request->is_set().

      The overwritten answers are caused by requesting $input_answers[$lang] on this line:
      https://github.com/phpbb/phpbb/blob/develop/phpBB/phpbb/captcha/plugins/qa.php#L700

      The $input_answers array doesn't use the language as array key because the language is stored with the question itself. This is probably a result of trying different approaches during original development of the captcha plugin system.

      A few lines earlier, a foreach loop for creating the language selectbox is also using $lang as variable name, which instantiates the variable and is the reason no "undefined var" error occured.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: