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

HTML entities not decoded in emailed message subject

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.9.7
    • 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
    • Messages
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE
    • Easy

      When a user send a message to another user an email is sent with the subject taken form the first line of the message. What if that line has special html characters? The bug first appeared with quotations being shown in the subject of the mail as follows:

      "Hi Susan i would like to"

      In order to solve this bug I propose to use html_entity_decode() php function. The code would be as follows:
      In /message/lib.php on line 975:

      $messagesubject = preg_replace('/\s+/', ' ', strip_tags($message)); // make sure it's all on one line

      $messagesubject = html_entity_decode($messagesubject);

      $messagesubject = message_shorten_message($messagesubject, 30).'...';

            andyjdavis Andrew Davis
            fbotti Federico Botti (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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