Skip to content

Commit

Permalink
Merge 0998c41 into cc9f12e
Browse files Browse the repository at this point in the history
  • Loading branch information
xvilo committed Nov 17, 2020
2 parents cc9f12e + 0998c41 commit d9b2c57
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ private static function scanString($xml, DOMDocument $dom = null, $libXmlConstan
}

if (! self::isPhpFpm()) {
$loadEntities = libxml_disable_entity_loader(true);
if (\PHP_VERSION_ID < 80000) {
$loadEntities = libxml_disable_entity_loader(true);
}
$useInternalXmlErrors = libxml_use_internal_errors(true);
}

Expand All @@ -75,7 +77,9 @@ private static function scanString($xml, DOMDocument $dom = null, $libXmlConstan
if (! $result) {
// Entity load to previous setting
if (! self::isPhpFpm()) {
libxml_disable_entity_loader($loadEntities);
if (\PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader($loadEntities);
}
libxml_use_internal_errors($useInternalXmlErrors);
}
return false;
Expand All @@ -94,7 +98,9 @@ private static function scanString($xml, DOMDocument $dom = null, $libXmlConstan

// Entity load to previous setting
if (! self::isPhpFpm()) {
libxml_disable_entity_loader($loadEntities);
if (\PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader($loadEntities);
}
libxml_use_internal_errors($useInternalXmlErrors);
}

Expand Down

0 comments on commit d9b2c57

Please sign in to comment.