]> 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)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Mon, 7 Nov 2022 13:32:13 +0000 (13:32 +0000)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/App/PlatformRepository.php

index 94fac5260e1555d8b8cffd7c6dd6e74b71f65b09..3e7f0f3c5a5a2f4897f80030f43b404f225fd717 100644 (file)
@@ -48,7 +48,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);
@@ -109,6 +109,9 @@ class PlatformRepository {
                                        continue 2;
                        }
 
+                       if ($prettyVersion === null) {
+                               continue;
+                       }
                        try {
                                $prettyVersion = $this->normalizeVersion($prettyVersion);
                        } catch (\UnexpectedValueException $e) {