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

Some forum mails not sent because of wrong html entity decoding

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.4, 2.4.1
    • Component/s: Forum
    • Labels:
    • Testing Instructions:
      Hide

      1/ execute phpunit tests in PHP 5.3.2-3
      2/ execute phpunit tests in PHP >= 5.3.4
      3/ execute phpunit tests in PHP >= 5.4.0

      4/ optionally verify GoogleSpellchecker is working for words with html entities
      5/ optionally compose forum post in markdown format with unicode HTML entities and verify mailed plain text version

      Show
      1/ execute phpunit tests in PHP 5.3.2-3 2/ execute phpunit tests in PHP >= 5.3.4 3/ execute phpunit tests in PHP >= 5.4.0 — 4/ optionally verify GoogleSpellchecker is working for words with html entities 5/ optionally compose forum post in markdown format with unicode HTML entities and verify mailed plain text version
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      w51_MDL-36212_m25_entities

      Description

      The default charset of get_html_translation_table() is ISO-8859-1 for versions of PHP prior to 5.4.0 (http://php.net/manual/en/function.get-html-translation-table.php).

      We've detected the problem because some forum emails (those with html entities) were not being sent because a database error (MySQL):

      Incorrect string value: '\xA0\xA0\xA0\xA0\xA0\xA0...' for column 'fullmessage' at row 1
      

      To fix the problem pass the encoding parameter to get_html_translation_table():

      get_html_translation_table(HTML_ENTITIES, ENT_COMPAT|ENT_HTML401, 'utf-8');
      

      Maybe other versions of moodle and other components are affected by this bug.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Jan/13