diff options
author | Joas Schilling <coding@schilljs.com> | 2019-03-20 12:21:01 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-03-20 15:16:13 +0100 |
commit | 2d00e2bbe77ab9bb150555e5cef7a269c8a25b4a (patch) | |
tree | 8c7244faa557fef63bc3a65f71a0ce4549966dca /lib/private/App/AppStore | |
parent | 95c9e0edd216e7a0afd16da27492ec833728bdb2 (diff) | |
download | nextcloud-server-2d00e2bbe77ab9bb150555e5cef7a269c8a25b4a.tar.gz nextcloud-server-2d00e2bbe77ab9bb150555e5cef7a269c8a25b4a.zip |
Do not ignore the max-version for the "update-available" check
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/App/AppStore')
-rw-r--r-- | lib/private/App/AppStore/Fetcher/AppFetcher.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php index 4067e03a818..9ad8f582460 100644 --- a/lib/private/App/AppStore/Fetcher/AppFetcher.php +++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php @@ -40,6 +40,9 @@ class AppFetcher extends Fetcher { /** @var CompareVersion */ private $compareVersion; + /** @var bool */ + private $ignoreMaxVersion; + /** * @param Factory $appDataFactory * @param IClientService $clientService @@ -65,6 +68,7 @@ class AppFetcher extends Fetcher { $this->fileName = 'apps.json'; $this->setEndpoint(); $this->compareVersion = $compareVersion; + $this->ignoreMaxVersion = true; } /** @@ -93,8 +97,11 @@ class AppFetcher extends Fetcher { $version = $versionParser->getVersion($release['rawPlatformVersionSpec']); $ncVersion = $this->getVersion(); $min = $version->getMinimumVersion(); + $max = $version->getMaximumVersion(); $minFulfilled = $this->compareVersion->isCompatible($ncVersion, $min, '>='); - if ($minFulfilled) { + $maxFulfilled = $max !== '' && + $this->compareVersion->isCompatible($ncVersion, $max, '<='); + if ($minFulfilled && ($this->ignoreMaxVersion || $maxFulfilled)) { $releases[] = $release; } } catch (\InvalidArgumentException $e) { @@ -137,10 +144,12 @@ class AppFetcher extends Fetcher { /** * @param string $version * @param string $fileName + * @param bool $ignoreMaxVersion */ - public function setVersion(string $version, string $fileName = 'apps.json') { + public function setVersion(string $version, string $fileName = 'apps.json', bool $ignoreMaxVersion = true) { parent::setVersion($version); $this->fileName = $fileName; + $this->ignoreMaxVersion = $ignoreMaxVersion; $this->setEndpoint(); } } |