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

Tab characters break forum JSON parsing

XMLWordPrintable

    • MOODLE_311_STABLE, MOODLE_38_STABLE, MOODLE_400_STABLE
    • MDL-68694-401-forum-subject-tab-fix
    • MDL-68694-MASTER-forum-subject-tab-fix
    • Hide
      • Delete any existing posts containing tab characters in the subject
      • Create a new forum post or reply
      • In the subject tab, copy and paste some text containing a tab character from another text editor (Word, for example), and submit the post
      • Open the developer console in your browser and enable the "persist logs" setting
      • Submit a reply to the post or access the forum grader
      • Verify that there is no message "JSON.parse: bad control character in string literal at line 1 column 17 of the JSON data" in the console
      Show
      Delete any existing posts containing tab characters in the subject Create a new forum post or reply In the subject tab, copy and paste some text containing a tab character from another text editor (Word, for example), and submit the post Open the developer console in your browser and enable the "persist logs" setting Submit a reply to the post or access the forum grader Verify that there is no message "JSON.parse: bad control character in string literal at line 1 column 17 of the JSON data" in the console

      Putting a tab character into the name of a discussion forum will trigger a JSON syntax error response whenever the post is displayed using AJAX.

       

      Reproduction steps:

      1. Create a new discussion forum
      2. Create a topic in the discussion forum with a tab character in the title (you will probably have to copy and paste it in)
      3. Reply to the discussion forum with the non advanced editor (that loads via ajax)
      4. A JSON parsing syntax error will be triggered when trying to parse the AJAX response

       

      Expected Behavior:

      The forum should post the response to the discussion.

      Observed Behavior:

      An error is thrown.

       

      This also affects loading discussions for grading.

            bryce.yoder@moodle.com Bryce Yoder
            schiem Michael Yoder
            Shamim Rezaie Shamim Rezaie
            Votes:
            11 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 5 hours, 16 minutes
                5h 16m

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