diff --git a/PhpOffice/PhpSpreadsheet/Reader/Security/XmlScanner.php b/PhpOffice/PhpSpreadsheet/Reader/Security/XmlScanner.php index 732f0bf..4798004 100644 --- a/PhpOffice/PhpSpreadsheet/Reader/Security/XmlScanner.php +++ b/PhpOffice/PhpSpreadsheet/Reader/Security/XmlScanner.php @@ -63,7 +63,7 @@ class XmlScanner private function disableEntityLoaderCheck() { - if (Settings::getLibXmlDisableEntityLoader()) { + if (Settings::getLibXmlDisableEntityLoader() && \PHP_VERSION_ID < 80000) { $libxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true); if (self::$libxmlDisableEntityLoaderValue === null) { @@ -74,7 +74,7 @@ class XmlScanner public static function shutdown() { - if (self::$libxmlDisableEntityLoaderValue !== null) { + if (self::$libxmlDisableEntityLoaderValue !== null && \PHP_VERSION_ID < 80000) { libxml_disable_entity_loader(self::$libxmlDisableEntityLoaderValue); self::$libxmlDisableEntityLoaderValue = null; }