Skip to content

Commit 52ce87b

Browse files
committed
PHP 8.0 - depracated libxml_disable_entity_loader, is disabled by default
1 parent 003217f commit 52ce87b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Common/XMLReader.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,14 @@ public function getDomFromZip($zipFile, $xmlFile)
7171
*/
7272
public function getDomFromString($content)
7373
{
74-
$originalLibXMLEntityValue = libxml_disable_entity_loader(true);
74+
if (\PHP_VERSION_ID < 80000) {
75+
$originalLibXMLEntityValue = libxml_disable_entity_loader(true);
76+
}
7577
$this->dom = new \DOMDocument();
7678
$this->dom->loadXML($content);
77-
libxml_disable_entity_loader($originalLibXMLEntityValue);
79+
if (\PHP_VERSION_ID < 80000) {
80+
libxml_disable_entity_loader($originalLibXMLEntityValue);
81+
}
7882

7983
return $this->dom;
8084
}

0 commit comments

Comments
 (0)