Wrap libxml_disable_entity_loader() calls in version constraint

Bug: T268847
Change-Id: I0b0dc4a334c7e30fd7af7a4b2d2ff45e609e7e0e
This commit is contained in:
Reedy 2020-12-27 16:29:56 +00:00
parent 1c8e91f11a
commit 8adb5e68ca

View file

@ -564,10 +564,17 @@ class RSSParser {
}
Wikimedia\suppressWarnings();
// Prevent loading external entities when parsing the XML (bug 46932)
$oldDisable = libxml_disable_entity_loader( true );
$oldDisable = false;
if ( LIBXML_VERSION < 20900 ) {
// Prevent loading external entities when parsing the XML (bug 46932)
$oldDisable = libxml_disable_entity_loader( true );
}
$this->xml->loadXML( $rawXML );
libxml_disable_entity_loader( $oldDisable );
if ( LIBXML_VERSION < 20900 ) {
libxml_disable_entity_loader( $oldDisable );
}
Wikimedia\restoreWarnings();
$this->rss = new RSSData( $this->xml );