diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-01-08 16:30:05 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2021-01-08 16:33:46 +0100 |
commit | f8efab7c850b96e7494a8d246e412e22f47ca06f (patch) | |
tree | 08398916849676acaf89ca49a0b152226b3a262c /lib/private | |
parent | e354ee4dc6bba95369cf4214880b6451123a4913 (diff) | |
download | nextcloud-server-f8efab7c850b96e7494a8d246e412e22f47ca06f.tar.gz nextcloud-server-f8efab7c850b96e7494a8d246e412e22f47ca06f.zip |
Only use libxml_disable_entity_loader on php older than 8
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private')
-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; |