-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.2.2
-
None
-
MOODLE_402_STABLE
As part of the preparation for PHP 8.2 a compatibility check was run of the existing Moodle LMS codebase (see: MDL-77104). As part of this check the following was raised:
FILE: /question/engine/renderer.php
------------------------------------------------------------------------------------------------------------------------
|
FOUND 1 ERROR AFFECTING 1 LINE
|
------------------------------------------------------------------------------------------------------------------------
|
183 | ERROR | The default value of the $flags parameter for html_entity_decode() was changed from ENT_COMPAT to
|
| | ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 in PHP 8.1. For cross-version compatibility, the $flags
|
| | parameter should be explicitly set.
|
------------------------------------------------------------------------------------------------------------------------
|
That is https://github.com/moodle/moodle/blame/master/question/engine/renderer.php#L183
To suppress this notification in the future $flags should be explicitly set to `ENT_NOQUOTES | ENT_HTML401 | ENT_SUBSTITUTE` to decode only the HTML entities that are not quotes. i.e.
$trimmed = trim(html_entity_decode($number, ENT_NOQUOTES | ENT_HTML401 | ENT_SUBSTITUTE), " \n\r\t\v\x00\xC2\xA0");
|
It doesn't change the existing functionality based on a code assessment, it's just better to be explicit. It also doesn't block PHP 8.2 compatibility for Moodle LMS
- is child of
-
MDL-77104 Perform a complete PHPCompatibility 8.2 execution against codebase
-
- Closed
-