diff options
author | Joas Schilling <coding@schilljs.com> | 2023-07-12 09:23:37 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-07-20 10:47:45 +0200 |
commit | 4a21e41313a19bb019258dd96cd83de452a55125 (patch) | |
tree | 763fdd17a9316d755e2363f5cb93c249578cccda /lib/private | |
parent | 7b4ed65fb09eca60bdf64c8a81962eb066cd2bcb (diff) | |
download | nextcloud-server-4a21e41313a19bb019258dd96cd83de452a55125.tar.gz nextcloud-server-4a21e41313a19bb019258dd96cd83de452a55125.zip |
fix(apps): Fix loading info.xml file
Ref: https://bugs.php.net/bug.php?id=62577
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/App/InfoParser.php | 6 | ||||
-rw-r--r-- | lib/private/Installer.php | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php index c0f69e615bd..79d051fd2a1 100644 --- a/lib/private/App/InfoParser.php +++ b/lib/private/App/InfoParser.php @@ -31,7 +31,7 @@ namespace OC\App; use OCP\ICache; use function libxml_disable_entity_loader; -use function simplexml_load_file; +use function simplexml_load_string; class InfoParser { /** @var \OCP\ICache|null */ @@ -63,10 +63,10 @@ class InfoParser { libxml_use_internal_errors(true); if ((PHP_VERSION_ID < 80000)) { $loadEntities = libxml_disable_entity_loader(false); - $xml = simplexml_load_file($file); + $xml = simplexml_load_string(file_get_contents($file)); libxml_disable_entity_loader($loadEntities); } else { - $xml = simplexml_load_file($file); + $xml = simplexml_load_string(file_get_contents($file)); } if ($xml === false) { diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 43c3db7c3fd..0458c14da8a 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -333,10 +333,10 @@ class Installer { // Check if appinfo/info.xml has the same app ID as well if ((PHP_VERSION_ID < 80000)) { $loadEntities = libxml_disable_entity_loader(false); - $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); + $xml = simplexml_load_string(file_get_contents($extractDir . '/' . $folders[0] . '/appinfo/info.xml')); libxml_disable_entity_loader($loadEntities); } else { - $xml = simplexml_load_file($extractDir . '/' . $folders[0] . '/appinfo/info.xml'); + $xml = simplexml_load_string(file_get_contents($extractDir . '/' . $folders[0] . '/appinfo/info.xml')); } if ((string)$xml->id !== $appId) { throw new \Exception( |