Fix phpversion() returning false when an extension has no version, fixes #10631

main
Jordi Boggiano 2 years ago
parent a2bdf72fa4
commit dec123770f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -98,7 +98,12 @@ class Runtime
*/ */
public function getExtensionVersion(string $extension): string public function getExtensionVersion(string $extension): string
{ {
return phpversion($extension); $version = phpversion($extension);
if ($version === false) {
$version = '0';
}
return $version;
} }
/** /**

@ -618,13 +618,8 @@ class PlatformRepository extends ArrayRepository
/** /**
* Parses the version and adds a new package to the repository * Parses the version and adds a new package to the repository
*
* @param string $name
* @param null|string $prettyVersion
*
* @return void
*/ */
private function addExtension(string $name, ?string $prettyVersion): void private function addExtension(string $name, string $prettyVersion): void
{ {
$extraDescription = null; $extraDescription = null;

Loading…
Cancel
Save