mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-76953 mod: deprecate libxml library method wrappers.
The `libxml_disable_entity_loader` method is deprecated since PHP8.0, which is our minimum required version so we no longer need to support calls to it using the current wrappers.
This commit is contained in:
parent
1b1a15a308
commit
436a279dec
5 changed files with 14 additions and 15 deletions
|
@ -4477,7 +4477,6 @@ function lti_load_cartridge($url, $map, $propertiesmap = array()) {
|
|||
|
||||
// TODO MDL-46023 Replace this code with a call to the new library.
|
||||
$origerrors = libxml_use_internal_errors(true);
|
||||
$origentity = lti_libxml_disable_entity_loader(true);
|
||||
libxml_clear_errors();
|
||||
|
||||
$document = new DOMDocument();
|
||||
|
@ -4489,7 +4488,6 @@ function lti_load_cartridge($url, $map, $propertiesmap = array()) {
|
|||
|
||||
libxml_clear_errors();
|
||||
libxml_use_internal_errors($origerrors);
|
||||
lti_libxml_disable_entity_loader($origentity);
|
||||
|
||||
if (count($errors) > 0) {
|
||||
$message = 'Failed to load cartridge.';
|
||||
|
@ -4584,10 +4582,10 @@ function lti_new_access_token($typeid, $scopes) {
|
|||
*
|
||||
* @param bool $value
|
||||
* @return bool
|
||||
*
|
||||
* @deprecated since Moodle 4.3
|
||||
*/
|
||||
function lti_libxml_disable_entity_loader(bool $value): bool {
|
||||
if (PHP_VERSION_ID < 80000) {
|
||||
return (bool)libxml_disable_entity_loader($value);
|
||||
}
|
||||
debugging(__FUNCTION__ . '() is deprecated, please do not use it any more', DEBUG_DEVELOPER);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -70,13 +70,10 @@ if ($consumerkey === false) {
|
|||
}
|
||||
|
||||
// TODO MDL-46023 Replace this code with a call to the new library.
|
||||
$origentity = lti_libxml_disable_entity_loader(true);
|
||||
$xml = simplexml_load_string($rawbody);
|
||||
if (!$xml) {
|
||||
lti_libxml_disable_entity_loader($origentity);
|
||||
throw new Exception('Invalid XML content');
|
||||
}
|
||||
lti_libxml_disable_entity_loader($origentity);
|
||||
|
||||
$body = $xml->imsx_POXBody;
|
||||
foreach ($body->children() as $child) {
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
This files describes API changes in the lti code.
|
||||
|
||||
=== 4.3 ===
|
||||
|
||||
* The `lti_libxml_disable_entity_loader` method is deprecated, as it is no longer required from PHP 8.0
|
||||
|
||||
=== 4.2 ===
|
||||
|
||||
* get_jwt_claim_mappings() function has been added to service_base class. It allows a service subplugin to be
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue