diff --git a/lib/base.php b/lib/base.php index 51279c8b70d6d..3e003be7f551e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -257,6 +257,8 @@ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig): voi private static function printUpgradePage(\OC\SystemConfig $systemConfig): void { $cliUpgradeLink = $systemConfig->getValue('upgrade.cli-upgrade-link', ''); $disableWebUpdater = $systemConfig->getValue('upgrade.disable-web', false); + $redirectUpgradePage = $systemConfig->getValue('upgrade.redirect_upgradepage_to_location', null); + $tooBig = false; if (!$disableWebUpdater) { $apps = Server::get(\OCP\App\IAppManager::class); @@ -292,6 +294,13 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void { $ignoreTooBigWarning = isset($_GET['IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup']) && $_GET['IKnowThatThisIsABigInstanceAndTheUpdateRequestCouldRunIntoATimeoutAndHowToRestoreABackup'] === 'IAmSuperSureToDoThis'; + if ($redirectUpgradePage !== null) { + http_response_code(302); + header('X-Nextcloud-needsDbUpgrade: 1'); + header("Location: ${redirectUpgradePage}#" . time()); + die(); + } + if ($disableWebUpdater || ($tooBig && !$ignoreTooBigWarning)) { // send http status 503 http_response_code(503);