]> source.dussan.org Git - nextcloud-server.git/commitdiff
Extend OC_Util::needUpgrade to also catch app upgrades
authorRobin Appelman <icewind@owncloud.com>
Thu, 24 Jul 2014 15:15:38 +0000 (17:15 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 4 Aug 2014 11:41:04 +0000 (13:41 +0200)
lib/private/util.php

index 896b076afa680f12e63406c0dcacbdf86273d4c7..3c832272ce8d989783154a26a60a7672d209f2ff 100755 (executable)
@@ -1462,7 +1462,18 @@ class OC_Util {
                if (OC_Config::getValue('installed', false)) {
                        $installedVersion = OC_Config::getValue('version', '0.0.0');
                        $currentVersion = implode('.', OC_Util::getVersion());
-                       return version_compare($currentVersion, $installedVersion, '>');
+                       if (version_compare($currentVersion, $installedVersion, '>')) {
+                               return true;
+                       }
+
+                       // also check for upgrades for apps
+                       $apps = \OC_App::getEnabledApps();
+                       foreach ($apps as $app) {
+                               if (\OC_App::shouldUpgrade($app)) {
+                                       return true;
+                               }
+                       }
+                       return false;
                } else {
                        return false;
                }