diff options
Diffstat (limited to 'vendor/sabre/xml/lib/Reader.php')
-rw-r--r-- | vendor/sabre/xml/lib/Reader.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index a28cf8c3b..368e8ffd2 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -55,7 +55,11 @@ class Reader extends XMLReader */ public function parse(): array { - $previousEntityState = libxml_disable_entity_loader(true); + $previousEntityState = null; + $shouldCallLibxmlDisableEntityLoader = (\PHP_VERSION_ID < 80000); + if ($shouldCallLibxmlDisableEntityLoader) { + $previousEntityState = libxml_disable_entity_loader(true); + } $previousSetting = libxml_use_internal_errors(true); try { @@ -78,7 +82,9 @@ class Reader extends XMLReader } } finally { libxml_use_internal_errors($previousSetting); - libxml_disable_entity_loader($previousEntityState); + if ($shouldCallLibxmlDisableEntityLoader) { + libxml_disable_entity_loader($previousEntityState); + } } return $result; |