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

"quote" Mustache helper only escapes first quote in JS

    XMLWordPrintable

Details

    • MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66542_master
    • Hide
      1. Login as Manager.
      2. Add upcoming_events block to your dashboard.
      3. Create assignment in one of your courses with:
        • Due date: tomorrow
        • Name: Double "quote" test
      4. Go to the dashboard.
        => You don't get a syntax error dialog.
      Show
      Login as Manager. Add upcoming_events block to your dashboard. Create assignment in one of your courses with: Due date: tomorrow Name: Double "quote" test Go to the dashboard. => You don't get a syntax error dialog.

    Description

      The JS variant of the "quote" Mustache helper only escapes the first double quote in the string. Responsible for that is this call: https://github.com/moodle/moodle/blob/0dca957716952323bd56089929ac6412136a29f1/lib/amd/src/templates.js#L487

      Steps to reproduce the problem:

      1. Login as Manager.
      2. Add upcoming_events block to your dashboard.
      3. Create assignment in one of your courses with:
        • Due date: tomorrow
        • Name: Double "quote" test
      4. Go to the dashboard.
        => You get a Syntax error "Unexpected token t in JSON at position 27".

      Attachments

        Issue Links

          Activity

            People

              tschroeder Tim Schroeder
              tschroeder Tim Schroeder
              Bas Brands Bas Brands
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Gladys Basiana Gladys Basiana
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Nov/19

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 55 minutes
                  55m