DOMDocument::loadHTML() expecting ';'
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Mahara | ||||||
23.04 |
In Progress
|
High
|
Unassigned |
Bug Description
While running /lib/cron.php I noticed a lot of PHP Warnings on the next page load. These are also in the error log.
My current suspicion is that these are triggered when trying to send e-mail about forum activity.
The actual error:
DOMDocument:
While this is a PHP Warning it isn't causing crashes. However, it will be filling up error logs and may be causing unexpected behaviour in other places.
This error is occurring whenever html2text() is called. This is calling HtmltoText which calls DOMDocument and this is where the error happens. When DOMDocument:
Showing the error in an interactive shell:
php > # Example 1:
php > $s = '<head><meta http-equiv=
php >
php > # Example 2 is to demonstrate a working version of the string:
php > $t = '<head><meta http-equiv=
php >
php > $doc = new DOMDocument;
php > $doc->loadHTML($s);
PHP Warning: DOMDocument:
PHP Warning: DOMDocument:
PHP Warning: DOMDocument:
PHP Warning: DOMDocument:
php > $doc->loadHTML($t);
php >
The examples I've been finding are in interaction_
The specific code that causes this to come about looks to be in in prepare_post_body() in htdocs/
Changed in mahara: | |
milestone: | none → 23.04.0 |
milestone: | 23.04.0 → 22.10.1 |
Changed in mahara: | |
milestone: | 23.04.0 → none |
no longer affects: | mahara |
no longer affects: | mahara/22.10 |
Patch for "main" branch: https:/ /reviews. mahara. org/c/mahara/ +/13797