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

"quote" Mustache helper only escapes first quote in JS

    XMLWordPrintable

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-66542_master

      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

              Assignee:
              tschroeder Tim Schroeder
              Reporter:
              tschroeder Tim Schroeder
              Peer reviewer:
              Bas Brands Bas Brands
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              Gladys Basiana Gladys Basiana
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Huong Nguyen, Bas Brands, Mathew May
              Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Nov/19

                  Time Tracking

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