Jump to content

Topic on Project:Support desk

Problem with Special:Import - libxml_disable_entity_loader() is deprecated

3
Raikkonso (talkcontribs)

Help! I'm trying to import a template using the Special:Import page. When I click on Upload, I get the following error messages:


Deprecated: Function libxml_disable_entity_loader() is deprecated in D:\xampp\htdocs\wiki\includes\import\WikiImporter.php on line 82

Deprecated: Function libxml_disable_entity_loader() is deprecated in D:\xampp\htdocs\wiki\includes\import\WikiImporter.php on line 94

Deprecated: Function libxml_disable_entity_loader() is deprecated in D:\xampp\htdocs\wiki\includes\import\WikiImporter.php on line 575

Deprecated: Function libxml_disable_entity_loader() is deprecated in D:\xampp\htdocs\wiki\includes\import\WikiImporter.php on line 630


This is the version I am using:

MediaWiki     1.35.2

PHP          8.0.6 (apache2handler)

MariaDB      10.4.19-MariaDB

Lua          5.1.4


I found the WikiImporter.php, but I don't know what I'm suppose to do with it. As far as I know, these are the default settings.


$oldDisable = libxml_disable_entity_loader( false ); --- Line 82

libxml_disable_entity_loader( $oldDisable ); --- Line 94

$oldDisable = libxml_disable_entity_loader( true ); --- Line 575

libxml_disable_entity_loader( $oldDisable ); --- Line 630

Ammarpad (talkcontribs)
Raikkonso (talkcontribs)

Thanks for the reply. Based on php.watch/versions/8.0/libxml_disable_entity_loader-deprecation

"On code that only runs on PHP 8.0 and later, it is now safe to remove all function calls."


Does that mean that I should remove the 4 lines from WikiImporter.php?

$oldDisable = libxml_disable_entity_loader( false ); --- Line 82

libxml_disable_entity_loader( $oldDisable ); --- Line 94

$oldDisable = libxml_disable_entity_loader( true ); --- Line 575

libxml_disable_entity_loader( $oldDisable ); --- Line 630

Reply to "Problem with Special:Import - libxml_disable_entity_loader() is deprecated"