summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-11-08 14:50:12 +0100
committerJoas Schilling <coding@schilljs.com>2018-11-08 14:52:28 +0100
commitb04a44babdecad235828505191f5b36f2605ec72 (patch)
tree512eceb03a437beeb5f33990f80b5e917ee1f1ca /apps/updatenotification/lib
parent90a35aab2970dd22c1503fcec73da1057efba491 (diff)
downloadnextcloud-server-b04a44babdecad235828505191f5b36f2605ec72.tar.gz
nextcloud-server-b04a44babdecad235828505191f5b36f2605ec72.zip
Use the version number when checking the appstore for compatible updates
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification/lib')
-rw-r--r--apps/updatenotification/lib/Command/Check.php2
-rw-r--r--apps/updatenotification/lib/Settings/Admin.php3
-rw-r--r--apps/updatenotification/lib/UpdateChecker.php5
3 files changed, 6 insertions, 4 deletions
diff --git a/apps/updatenotification/lib/Command/Check.php b/apps/updatenotification/lib/Command/Check.php
index f363832873b..fac4e4201f2 100644
--- a/apps/updatenotification/lib/Command/Check.php
+++ b/apps/updatenotification/lib/Command/Check.php
@@ -67,7 +67,7 @@ class Check extends Command {
// Server
$r = $this->updateChecker->getUpdateState();
if (isset($r['updateAvailable']) && $r['updateAvailable']) {
- $output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.');
+ $output->writeln($r['updateVersionString'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.');
$updatesAvailableCount += 1;
}
diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php
index 54adf558224..b1abdd874d1 100644
--- a/apps/updatenotification/lib/Settings/Admin.php
+++ b/apps/updatenotification/lib/Settings/Admin.php
@@ -97,7 +97,8 @@ class Admin implements ISettings {
'lastChecked' => $lastUpdateCheck,
'currentChannel' => $currentChannel,
'channels' => $channels,
- 'newVersionString' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
+ 'newVersion' => empty($updateState['updateVersion']) ? '' : $updateState['updateVersion'],
+ 'newVersionString' => empty($updateState['updateVersionString']) ? '' : $updateState['updateVersionString'],
'downloadLink' => empty($updateState['downloadLink']) ? '' : $updateState['downloadLink'],
'changes' => $this->filterChanges($updateState['changes'] ?? []),
'updaterEnabled' => empty($updateState['updaterEnabled']) ? false : $updateState['updaterEnabled'],
diff --git a/apps/updatenotification/lib/UpdateChecker.php b/apps/updatenotification/lib/UpdateChecker.php
index bd03cb442be..6375e21b084 100644
--- a/apps/updatenotification/lib/UpdateChecker.php
+++ b/apps/updatenotification/lib/UpdateChecker.php
@@ -51,7 +51,8 @@ class UpdateChecker {
if (isset($data['version']) && $data['version'] !== '' && $data['version'] !== []) {
$result['updateAvailable'] = true;
- $result['updateVersion'] = $data['versionstring'];
+ $result['updateVersion'] = $data['version'];
+ $result['updateVersionString'] = $data['versionstring'];
$result['updaterEnabled'] = $data['autoupdater'] === '1';
$result['versionIsEol'] = $data['eol'] === '1';
if (strpos($data['web'], 'https://') === 0) {
@@ -80,7 +81,7 @@ class UpdateChecker {
public function populateJavaScriptVariables(array $data) {
$data['array']['oc_updateState'] = json_encode([
'updateAvailable' => true,
- 'updateVersion' => $this->getUpdateState()['updateVersion'],
+ 'updateVersion' => $this->getUpdateState()['updateVersionString'],
'updateLink' => $this->getUpdateState()['updateLink'] ?? '',
]);
}