Do not update incompatible apps

Previously there was no (platform) dependency check for an app that was
installed before. So Nextcloud happily upgraded an app that now requires
a php version newer than the current one. Which means in the lucky case
you see a failing upgrade due to the language incompatibility, or in the
unlucky case you see unexpected errors later in production.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2020-11-26 16:44:20 +01:00
parent f0862dcfaa
commit cbb34af53f
No known key found for this signature in database
GPG Key ID: CC42AC2A7F0E56D8
2 changed files with 10 additions and 1 deletions

View File

@ -360,7 +360,7 @@ class Updater extends BasicEmitter {
$disabledApps = [];
$appManager = \OC::$server->getAppManager();
foreach ($apps as $app) {
// check if the app is compatible with this version of ownCloud
// check if the app is compatible with this version of Nextcloud
$info = OC_App::getAppInfo($app);
if ($info === null || !OC_App::isAppCompatible($version, $info)) {
if ($appManager->isShipped($app)) {

View File

@ -974,6 +974,15 @@ class OC_App {
\OC::$server->getAppManager()->clearAppsCache();
$appData = self::getAppInfo($appId);
$ignoreMaxApps = \OC::$server->getConfig()->getSystemValue('app_install_overwrite', []);
$ignoreMax = in_array($appId, $ignoreMaxApps, true);
\OC_App::checkAppDependencies(
\OC::$server->getConfig(),
\OC::$server->getL10N('core'),
$appData,
$ignoreMax
);
self::registerAutoloading($appId, $appPath, true);
self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']);