Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15331

Feedback fails to remove slashes when editing questions in 1.9.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.1
    • 1.9, 1.9.1
    • Feedback
    • None
    • Feedback (2008050108), Moodle 1.9.1 (Build: 20080515), RHEL Linux 4, PHP 5.2.0, 5.0.27
    • MySQL
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      When you edit a question in Feedback under Moodle 1.9, the backslashes used to escape quotes and apostrophes in the database are not being stripped out by the module. As a result, the slashes show up when you're editing the question, and are saved to the database when you save the question.

      To recreate the problem:

      1. Create a Feedback.
      2. Add a question with a quote or apostrophe in it.
      3. Save the question.
      4. Edit the question. The backslash should appear.
      5. Save the question. The backslash is saved to the database.

      The problem is that the 1.9 version of Moodle 1.9 is not using stripslashes_safe when it's loading the question text. The problem occurs with all of the question types and can be fixed by changing this line:

      $item->name = empty($item->name) ? '' : $item->name;

      to this:

      $item->name = empty($item->name) ? '' : stripslashes_safe($item->name);

      I've attached a patch that makes this change to the affected questions.

            grabs Andreas Grabs
            lafayettenuke Kenneth Newquist (Inactive)
            Jérôme Mouneyrac Jérôme Mouneyrac
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.