Skip to content

Commit 898b8dc

Browse files
authored
Merge pull request #185 from nextcloud/Rello-patch-1
catch translated channel names
2 parents a72da8c + 7b370f5 commit 898b8dc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

index.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464
exit();
6565
}
6666

67+
$allowedChannels = ['stable', 'daily', 'beta', 'enterprise'];
68+
6769
// Read parameters
6870
$oem = isset($_GET['oem']) ? (string)$_GET['oem'] : null;
6971
$platform = isset($_GET['platform']) ? (string)$_GET['platform'] : null;
@@ -72,7 +74,10 @@
7274
$version = isset($_GET['version']) ? (string)$_GET['version'] : null;
7375
$isSparkle = isset($_GET['sparkle']) ? true : false;
7476
$isFileProvider = isset($_GET['fileprovider']) ? true : false;
75-
$channel = isset($_GET['channel']) ? (string)$_GET['channel'] : 'stable';
77+
// due to a bug in an old version, the channels were translated. we need to catch them again
78+
$channel = isset($_GET['channel']) && in_array((string)$_GET['channel'], $allowedChannels, true)
79+
? (string)$_GET['channel']
80+
: 'stable';
7681

7782
$osRelease = isset($_GET['osRelease']) ? (string)$_GET['osRelease'] : '';
7883
$osVersion = isset($_GET['osVersion']) ? (string)$_GET['osVersion'] : '';

0 commit comments

Comments
 (0)