diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-11-03 11:53:51 +0100 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-11-03 11:53:51 +0100 |
commit | 56f24cff9f1c2b7aed81886f93404b055bb90107 (patch) | |
tree | 190cb6746e6e167db23220379b3f71fd15aa956d /lib | |
parent | bfb764b5f3a26add7059391134c86a1fca460dfd (diff) | |
download | nextcloud-server-56f24cff9f1c2b7aed81886f93404b055bb90107.tar.gz nextcloud-server-56f24cff9f1c2b7aed81886f93404b055bb90107.zip |
Avoid a crash when a PHP extension has no version
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/PlatformRepository.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/App/PlatformRepository.php b/lib/private/App/PlatformRepository.php index 4166c2ead03..9d8d274c7fd 100644 --- a/lib/private/App/PlatformRepository.php +++ b/lib/private/App/PlatformRepository.php @@ -50,7 +50,7 @@ class PlatformRepository { $ext = new \ReflectionExtension($name); try { $prettyVersion = $ext->getVersion(); - $prettyVersion = $this->normalizeVersion($prettyVersion); + $prettyVersion = $this->normalizeVersion($prettyVersion ?? '0'); } catch (\UnexpectedValueException $e) { $prettyVersion = '0'; $prettyVersion = $this->normalizeVersion($prettyVersion); @@ -111,6 +111,9 @@ class PlatformRepository { continue 2; } + if ($prettyVersion === null) { + continue; + } try { $prettyVersion = $this->normalizeVersion($prettyVersion); } catch (\UnexpectedValueException $e) { |