mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Merge pull request #34998 from nextcloud/backport/34937/stable25
[stable25] Avoid a crash when a PHP extension has no version
This commit is contained in:
commit
1b9866fa45
1 changed files with 8 additions and 1 deletions
|
|
@ -50,7 +50,11 @@ class PlatformRepository {
|
|||
$ext = new \ReflectionExtension($name);
|
||||
try {
|
||||
$prettyVersion = $ext->getVersion();
|
||||
$prettyVersion = $this->normalizeVersion($prettyVersion);
|
||||
/** @psalm-suppress TypeDoesNotContainNull
|
||||
* @psalm-suppress RedundantCondition
|
||||
* TODO Remove these annotations once psalm fixes the method signature ( https://github.com/vimeo/psalm/pull/8655 )
|
||||
*/
|
||||
$prettyVersion = $this->normalizeVersion($prettyVersion ?? '0');
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
$prettyVersion = '0';
|
||||
$prettyVersion = $this->normalizeVersion($prettyVersion);
|
||||
|
|
@ -111,6 +115,9 @@ class PlatformRepository {
|
|||
continue 2;
|
||||
}
|
||||
|
||||
if ($prettyVersion === null) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$prettyVersion = $this->normalizeVersion($prettyVersion);
|
||||
} catch (\UnexpectedValueException $e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue