From 151abca91c300149ee9489489a7d17414bd3838a Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Thu, 14 Jan 2021 22:54:53 +0000 Subject: [PATCH 1/2] 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 --- lib/private/App/AppStore/Fetcher/AppFetcher.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 4dc517879e..70bf2a37d9 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, '<=' From 8103fd98d10b54f14b0c30c85fc9858386af84bc Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 15 Jan 2021 16:55:47 +0100 Subject: [PATCH 2/2] Update psalm baseline to allow warning of implicit cast to string Signed-off-by: Morris Jobke --- build/psalm-baseline.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 4d78638e38..1e0c40d7d2 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -2618,8 +2618,9 @@ - - $qb->createNamedParameter($fdns, QueryBuilder::PARAM_STR_ARRAY) + + $qb->createNamedParameter($dnList, QueryBuilder::PARAM_STR_ARRAY) + $qb->createNamedParameter($fdnsSlice, QueryBuilder::PARAM_STR_ARRAY)