summaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-11-25 11:32:46 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-11-25 11:32:46 +0100
commit29402e2c0afc711040881fd013ff75aa07903f26 (patch)
tree8244ec37b54d9a962f7e2e9c233592be356cfffe /lib/private/App
parent1967b9112c237f8ed825d3fc664edf96e97f9514 (diff)
downloadnextcloud-server-29402e2c0afc711040881fd013ff75aa07903f26.tar.gz
nextcloud-server-29402e2c0afc711040881fd013ff75aa07903f26.zip
Exclude pre-release versions as per SemVer
As SemVer can be used apps could define a release like "10.0.0-alpha". This is something that we don't support at the moment in the server and we should filter all prereleases. Ref https://github.com/nextcloud/server/pull/2307#issuecomment-262911588 Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppStore/Fetcher/AppFetcher.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/private/App/AppStore/Fetcher/AppFetcher.php b/lib/private/App/AppStore/Fetcher/AppFetcher.php
index 32c207e3ac0..bbe75c723d5 100644
--- a/lib/private/App/AppStore/Fetcher/AppFetcher.php
+++ b/lib/private/App/AppStore/Fetcher/AppFetcher.php
@@ -79,17 +79,18 @@ class AppFetcher extends Fetcher {
// Filter all compatible releases
foreach($app['releases'] as $release) {
- // Exclude all nightly releases
- if($release['isNightly'] === false) {
+ // Exclude all nightly and pre-releases
+ if($release['isNightly'] === false
+ && strpos($release['version'], '-') === false) {
// Exclude all versions not compatible with the current version
$versionParser = new VersionParser();
$version = $versionParser->getVersion($release['rawPlatformVersionSpec']);
-
- if(
+ if (
// Major version is bigger or equals to the minimum version of the app
version_compare($ncMajorVersion, $version->getMinimumVersion(), '>=')
// Major version is smaller or equals to the maximum version of the app
- && version_compare($ncMajorVersion, $version->getMaximumVersion(), '<=')) {
+ && version_compare($ncMajorVersion, $version->getMaximumVersion(), '<=')
+ ) {
$releases[] = $release;
}
}
@@ -118,6 +119,7 @@ class AppFetcher extends Fetcher {
}
}
+ $response['data'] = array_values($response['data']);
return $response;
}
}