-
Bug
-
Resolution: Fixed
-
Blocker
-
4.3
-
MOODLE_403_STABLE
-
MOODLE_403_STABLE
-
master_
MDL-78893 -
-
1
-
Team Hedgehog 2023 Sprint 3.1
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: /iplookup/index.php
------------------------------------------------------------------------------------------------------------------------
|
FOUND 1 ERROR AFFECTING 1 LINE
|
------------------------------------------------------------------------------------------------------------------------
|
109 | ERROR | The default value of the $flags parameter for htmlspecialchars() 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.
|
------------------------------------------------------------------------------------------------------------------------
|
We should explicitly set the flags to: `ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE` to convert both single and double quotes to prevent any potential issues and to remove the notification in future checks. i.e.
echo '<h1 class="iplookup h2">' . htmlspecialchars($title, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE) . '</h1>';
|
This issue doesn't block PHP 8.2 compatibility for Moodle LMS 4.2.2 as the change is only in master