]> source.dussan.org Git - nextcloud-server.git/commitdiff
Avoid a crash when a PHP extension has no version
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 3 Nov 2022 10:53:51 +0000 (11:53 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 3 Nov 2022 10:53:51 +0000 (11:53 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/App/PlatformRepository.php

index 4166c2ead03b0add89b922d0a7eb35eafcf81086..9d8d274c7fd1c282692c3c65f66a0cbbf522a513 100644 (file)
@@ -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) {