diff options
author | Damien Goutte-Gattat <dgouttegattat@incenp.org> | 2021-01-14 22:54:53 +0000 |
---|---|---|
committer | Damien Goutte-Gattat <dgouttegattat@incenp.org> | 2021-01-14 23:03:20 +0000 |
commit | bedd9acf7874b836bef224989c2ce7f5e3b0a2fa (patch) | |
tree | 19b15fdb4fd7878cef9f5f77a7b90981b6f18d2b /lib/private | |
parent | ceb3a0090ed1f9f94312097519ee10d42a4a3811 (diff) | |
download | nextcloud-server-bedd9acf7874b836bef224989c2ce7f5e3b0a2fa.tar.gz nextcloud-server-bedd9acf7874b836bef224989c2ce7f5e3b0a2fa.zip |
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: Damien Goutte-Gattat <dgouttegattat@incenp.org>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/AppFetcher.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 4dc517879e8..70bf2a37d9d 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -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, '<=' |