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

Special characters not decoded in feedback edition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.5.6, 3.6.4
    • 3.1.9, 3.4.2, 3.5.1, 3.5.5, 3.6.3
    • Feedback
    • MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_35_STABLE, MOODLE_36_STABLE
    • MDL-62307_master
    • Easy
    • Hide
      1. Log in as an admin or a teacher in a course.
      2. Create a feedback activity in a course.
      3. Under "Question and submission settings", set the following values:
        Record user names User's name will be logged and shown with answers
        Allow multiple submissions Yes
      4. Add a short text answer question.
      5. As a student, fill in the feedback (adding, at least, the following characters: ' &  " < and >) and submit.
      6. Go back to the course.
      7. As a student, click the "Answer the questions" button again, to edit your responses.
      8. Confirm - Special characters appear properly.
      Show
      Log in as an admin or a teacher in a course. Create a feedback activity in a course. Under " Question and submission settings ", set the following values: Record user names User's name will be logged and shown with answers Allow multiple submissions Yes Add a short text answer question. As a student, fill in the feedback (adding, at least, the following characters: ' &  " < and >) and submit. Go back to the course. As a student, click the "Answer the questions" button again, to edit your responses. Confirm  - Special characters appear properly.

      The special characters (quotes, amps) are not HTML decoded, when they are displayed as initial values in a feedback form.

      Steps te reproduce:

      • Create a course
      • Insert a feedback module, and configure it to record "User's name will be logged and shown with answers" and "Allow multiple submissions".
      • As a student, fill in the feedback (adding ' & ) and submit
      • Go back to the course
      • As student, click the "Answer the questions" button again, to edit your responses.
      • => You see html encoded characters

       

      Here's a suggested fix:

      /mod/feedback/classes/complete_form.php:319

      $this->_form->setDefault($element->getName(), htmlspecialchars_decode($tmpvalue, ENT_QUOTES));
      

      Affects versions 3.4.2 and 3.1.9 for sure. Probably affects other versions (not tested).

        1. feedbackamp.png
          feedbackamp.png
          14 kB
        2. Screenshot (685).png
          Screenshot (685).png
          98 kB
        3. Screenshot (685)-1.png
          Screenshot (685)-1.png
          98 kB
        4. Screenshot (685)-2.png
          Screenshot (685)-2.png
          98 kB
        5. screenshot-1.png
          screenshot-1.png
          111 kB

            codes12 Maksud R
            mcornut Cornut Matthieu
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Jun Pataleta Jun Pataleta
            Janelle Barcega Janelle Barcega
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h

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