From 2b2ec5e7f7dd62ab2cbe30485117020beda0bf74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 3 Nov 2022 11:53:51 +0100 Subject: [PATCH] Avoid a crash when a PHP extension has no version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/App/PlatformRepository.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {