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

Forum email subjects containing ampersand are sent as &

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Set $CFG->divertallemailsto = 'youremailaddress'; in config.php
      2. As admin..
      3. Create a course and name its shortname "A&B"
      4. Enrol a student
      5. Add a news forum
      6. Create a new post titled "Test & Test" with a message
      7. Tick the mail now button and post to forum
      8. hit admin/cron.php (hopefully there will be a message about forum mailed out)
      9. Check your inbox and look at the title of the email
      Show
      Set $CFG->divertallemailsto = 'youremailaddress'; in config.php As admin.. Create a course and name its shortname "A&B" Enrol a student Add a news forum Create a new post titled "Test & Test" with a message Tick the mail now button and post to forum hit admin/cron.php (hopefully there will be a message about forum mailed out) Check your inbox and look at the title of the email
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:

      Description

      Forum email subject lines for topics with ampersand (&) in them are being replaced with &

      Other special characters do not seem to be affected. It appears format_string is responsible for this mangling:

      $string = replace_ampersands_not_followed_by_entity($string);

      Patch incoming that adds a simple html_entity_decode after this step, so the email subject line is returned to normal.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Jul/12