Activity log for bug #1836588

Date Who What changed Old value New value Message
2019-07-15 13:49:26 Mitsuhiro Yoshida bug added bug
2019-07-15 13:49:26 Mitsuhiro Yoshida attachment added Page comment broken screenshot https://bugs.launchpad.net/bugs/1836588/+attachment/5277165/+files/mahara_comment.png
2019-07-15 13:50:42 Mitsuhiro Yoshida mahara: importance Undecided High
2019-07-16 14:12:17 Mitsuhiro Yoshida description When we post English and Japanese comments on a page "Add comment" field, only Japanese characters are corrupted as the attached screenshot (mahara_comment.png). We can fix the issue using mb_convert_encoding function as below. Hopefully this fix helps Mahara multibyte character users. --------------------------- Program file to modify: artefact/comment/lib.php Line number to modify; 1184 [ Before ] /* * Removes the classes from the text of the comment that could interfere * with the comment display * @param string $comment the text content of the comment */ public static function remove_comments_classes($comment) { if (empty($comment)) { return ""; } $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); [ After ] /* * Removes the classes from the text of the comment that could interfere * with the comment display * @param string $comment the text content of the comment */ public static function remove_comments_classes($comment) { if (empty($comment)) { return ""; } $dom = new DOMDocument(); $dom->preserveWhiteSpace = false; $dom->formatOutput = true; // $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); if (function_exists('mb_convert_encoding')) { $dom->loadHTML(mb_convert_encoding($comment, 'HTML-ENTITIES', 'UTF-8')); } else $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); } $xpath = new DOMXPath($dom); When we post English and Japanese comments on a page "Add comment" field, only Japanese characters are corrupted as the attached screenshot (mahara_comment.png). We can fix the issue using mb_convert_encoding function as below. Hopefully this fix helps Mahara multibyte character users. --------------------------- Program file to modify: artefact/comment/lib.php Line number to modify; 1184 [ Before ]     /*      * Removes the classes from the text of the comment that could interfere      * with the comment display      * @param string $comment the text content of the comment      */     public static function remove_comments_classes($comment) {         if (empty($comment)) {             return "";         }         $dom = new DOMDocument();         $dom->preserveWhiteSpace = false;         $dom->formatOutput = true;         $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);         $xpath = new DOMXPath($dom); [ After ]     /*      * Removes the classes from the text of the comment that could interfere      * with the comment display      * @param string $comment the text content of the comment      */     public static function remove_comments_classes($comment) {         if (empty($comment)) {             return "";         }         $dom = new DOMDocument();         $dom->preserveWhiteSpace = false;         $dom->formatOutput = true; // $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);         if (function_exists('mb_convert_encoding')) {             $dom->loadHTML(mb_convert_encoding($comment, 'HTML-ENTITIES', 'UTF-8'));         } else {             $dom->loadHTML($comment, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);         }         $xpath = new DOMXPath($dom);
2019-07-16 14:17:33 Mitsuhiro Yoshida attachment added diff file for artefact/comment/lib.php https://bugs.launchpad.net/mahara/+bug/1836588/+attachment/5277407/+files/lib.php.diff
2019-08-12 15:44:36 Octavio Jr bug added subscriber Octavio Jr
2019-09-08 05:06:21 Kristina Hoeppner mahara: status New In Progress
2019-09-19 19:42:47 Robert Lyon mahara: status In Progress Fix Committed
2019-09-19 19:43:37 Robert Lyon nominated for series mahara/19.04
2019-09-19 19:43:37 Robert Lyon bug task added mahara/19.04
2019-09-19 19:43:37 Robert Lyon nominated for series mahara/19.10
2019-09-19 19:43:37 Robert Lyon bug task added mahara/19.10
2019-09-19 19:43:44 Robert Lyon mahara/19.04: milestone 19.04.2
2019-09-19 19:43:50 Robert Lyon mahara/19.04: importance Undecided High
2019-09-19 19:43:53 Robert Lyon mahara/19.04: status New Fix Committed
2019-10-31 05:44:27 Lisa Seeto mahara/19.10: status Fix Committed Fix Released
2019-10-31 22:47:37 Robert Lyon mahara/19.04: status Fix Committed Fix Released