diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2021-01-11 16:14:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-11 16:14:38 +0100 |
commit | fdd111924fc38aebd23ca2db9ecebfc4480eb026 (patch) | |
tree | 26c1731abe16fb18632e4b306c3896f98e05d9b9 | |
parent | a599a7d0993b9888720e713c6460cb2004850670 (diff) | |
parent | f8efab7c850b96e7494a8d246e412e22f47ca06f (diff) | |
download | nextcloud-server-fdd111924fc38aebd23ca2db9ecebfc4480eb026.tar.gz nextcloud-server-fdd111924fc38aebd23ca2db9ecebfc4480eb026.zip |
Merge pull request #25039 from nextcloud/fix/libxml-use-internal-errors-deprecated
Only use libxml_disable_entity_loader on php older than 8
-rw-r--r-- | lib/private/App/InfoParser.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php index 6a56259a3f5..c87dd1ae2a4 100644 --- a/lib/private/App/InfoParser.php +++ b/lib/private/App/InfoParser.php @@ -32,6 +32,8 @@ namespace OC\App; use OCP\ICache; +use function libxml_disable_entity_loader; +use function simplexml_load_file; class InfoParser { /** @var \OCP\ICache|null */ @@ -61,10 +63,14 @@ class InfoParser { } libxml_use_internal_errors(true); - $loadEntities = libxml_disable_entity_loader(false); - $xml = simplexml_load_file($file); + if ((PHP_VERSION_ID < 80000)) { + $loadEntities = libxml_disable_entity_loader(false); + $xml = simplexml_load_file($file); + libxml_disable_entity_loader($loadEntities); + } else { + $xml = simplexml_load_file($file); + } - libxml_disable_entity_loader($loadEntities); if ($xml === false) { libxml_clear_errors(); return null; |