Skip to content
Snippets Groups Projects
Commit bedd9acf authored by Damien Goutte-Gattat's avatar Damien Goutte-Gattat
Browse files

Fix comparison of PHP versions


Use the builtin function `version_compare` to check an app's
compatibility with the available PHP version, instead of reusing
the `OC\App\CompareVersion::isCompatible` method which is intended
to compare Nextcloud versions. PHP version strings do not always
necessarily follow the simple Major.Minor.Patch format used by
Nextcloud and therefore cannot be properly compared by that method.

Signed-off-by: default avatarDamien Goutte-Gattat <dgouttegattat@incenp.org>
parent ceb3a009
No related branches found
No related tags found
No related merge requests found
......@@ -113,12 +113,12 @@ class AppFetcher extends Fetcher {
$phpVersion = $versionParser->getVersion($release['rawPhpVersionSpec']);
$minPhpVersion = $phpVersion->getMinimumVersion();
$maxPhpVersion = $phpVersion->getMaximumVersion();
$minPhpFulfilled = $minPhpVersion === '' || $this->compareVersion->isCompatible(
$minPhpFulfilled = $minPhpVersion === '' || version_compare(
PHP_VERSION,
$minPhpVersion,
'>='
);
$maxPhpFulfilled = $maxPhpVersion === '' || $this->compareVersion->isCompatible(
$maxPhpFulfilled = $maxPhpVersion === '' || version_compare(
PHP_VERSION,
$maxPhpVersion,
'<='
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment