Multibyte comments broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Unassigned | ||
19.04 |
Fix Released
|
High
|
Unassigned | ||
19.10 |
Fix Released
|
High
|
Unassigned |
Bug Description
When we post English and Japanese comments on a page "Add comment" field, only Japanese characters are corrupted as the attached screenshot (mahara_
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/
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_
if (empty($comment)) {
return "";
}
$dom = new DOMDocument();
$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_
if (empty($comment)) {
return "";
}
$dom = new DOMDocument();
// $dom->loadHTML(
if (function_
} else {
}
$xpath = new DOMXPath($dom);
description: | updated |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Thank you Mits. We'll add this to our code review.
If you like, you can connect to the Mahara code review yourself in order to submit your patches straight into it. Instructions are available at https:/ /wiki.mahara. org/wiki/ Developer_ Area/Contributi ng_Code