mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RSS
synced 2024-09-23 18:29:51 +00:00
Wrap libxml_disable_entity_loader() calls in version constraint
Bug: T268847 Change-Id: I0b0dc4a334c7e30fd7af7a4b2d2ff45e609e7e0e
This commit is contained in:
parent
1c8e91f11a
commit
8adb5e68ca
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue