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

Mustache template over-escaping in forum emails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Component/s: Forum
    • Testing Instructions:
      Hide
      1. run mod_forum tests. All the supported combinations are tested there.
      2. Create a user fullname, a course shortname, a forum title and a discussion/post subject with attachments (2 ideally), containing any text and a combination of these characters: single quote ('), double quote ("), ampersand (&) and greater than (>). Trick, surely you'll want to tick the "send now" option.
      3. Enrol another user in the course. Go to his messaging preferences and ensure the mail format is html (pretty). Ensure that you can receive mails sent to that user (by email address of by using $CFG->divertallemailsto.
      4. Verify the discussion looks ok in the web (all those special chars).
      5. Execute forum cron.
      6. Fetch email and verify the subject and, specially the body, show all special chars ok. None escaped (&... . Also verify all the links (specially the attachments ones) work ok.
      7. Create another post with the same characteristics than the previous one. This time avoid double quotes in user name and course name. There is a know issue (MDL-52136) about that.
      8. Now set the messaging preferences to ensure the mail format is text (plain).
      9. Execute forum cron.
      10. Fetch email and verify the subject and, specially the body, show the quotes properly. But both the ampersands (&) and the greater than (>) are shown escaped ( & and > ) here and there. There is an old issue about that happening, MDL-19829) never solved so ignore them here.
      11. Repeat steps above but getting forum mails in digest formats (complete and subjects), both with the user receiving messages in pretty and plain formats.
      Show
      run mod_forum tests. All the supported combinations are tested there. Create a user fullname, a course shortname, a forum title and a discussion/post subject with attachments (2 ideally), containing any text and a combination of these characters: single quote ('), double quote ("), ampersand (&) and greater than (>). Trick, surely you'll want to tick the "send now" option. Enrol another user in the course. Go to his messaging preferences and ensure the mail format is html (pretty). Ensure that you can receive mails sent to that user (by email address of by using $CFG->divertallemailsto . Verify the discussion looks ok in the web (all those special chars). Execute forum cron. Fetch email and verify the subject and, specially the body, show all special chars ok. None escaped (&... . Also verify all the links (specially the attachments ones) work ok. Create another post with the same characteristics than the previous one. This time avoid double quotes in user name and course name . There is a know issue ( MDL-52136 ) about that. Now set the messaging preferences to ensure the mail format is text (plain). Execute forum cron. Fetch email and verify the subject and, specially the body, show the quotes properly. But both the ampersands (&) and the greater than (>) are shown escaped ( & and > ) here and there. There is an old issue about that happening, MDL-19829 ) never solved so ignore them here. Repeat steps above but getting forum mails in digest formats (complete and subjects), both with the user receiving messages in pretty and plain formats.
    • Affected Branches:
      MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      https://moodle.org/mod/forum/discuss.php?d=322862

      {{ sometext }} => {{

      { sometext }

      }}

      for text-based emails

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              dobedobedoh Andrew Nicols
              Integrator:
              Dan Poltawski
              Tester:
              Dan Poltawski
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                16/Nov/15