Extend OC_Util::needUpgrade to also catch app upgrades

This commit is contained in:
Robin Appelman 2014-07-24 17:15:38 +02:00
parent 65903a012a
commit 43d790239d
1 changed files with 12 additions and 1 deletions

View File

@ -1462,7 +1462,18 @@ class OC_Util {
if (OC_Config::getValue('installed', false)) { if (OC_Config::getValue('installed', false)) {
$installedVersion = OC_Config::getValue('version', '0.0.0'); $installedVersion = OC_Config::getValue('version', '0.0.0');
$currentVersion = implode('.', OC_Util::getVersion()); $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 { } else {
return false; return false;
} }