Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Avoid a crash when a PHP extension has no version
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and backportbot-nextcloud[bot] committed Nov 7, 2022
commit fe5ac24949a6a30a023f10a57375a7bf067a92d4
5 changes: 4 additions & 1 deletion lib/private/App/PlatformRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected function initialize() {
$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);
Expand Down Expand Up @@ -109,6 +109,9 @@ protected function initialize() {
continue 2;
}

if ($prettyVersion === null) {
continue;
}
try {
$prettyVersion = $this->normalizeVersion($prettyVersion);
} catch (\UnexpectedValueException $e) {
Expand Down