Bypass upgrade page when occ controller is requested (#25363)

This commit is contained in:
VicDeo 2016-07-06 23:08:58 +03:00 committed by Thomas Müller
parent ad67b3f0b0
commit 445a76bb1b
1 changed files with 15 additions and 3 deletions

View File

@ -847,10 +847,14 @@ class OC {
}
$request = \OC::$server->getRequest();
// Check if requested URL matches 'index.php/occ'
$isOccControllerRequested = preg_match('|/index\.php$|', $request->getScriptName()) === 1
&& strpos($request->getPathInfo(), '/occ/') === 0;
$requestPath = $request->getRawPathInfo();
if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
self::checkMaintenanceMode($request);
self::checkUpgrade();
$needUpgrade = self::checkUpgrade(!$isOccControllerRequested);
}
// emergency app disabling
@ -868,8 +872,16 @@ class OC {
exit();
}
// Always load authentication apps
OC_App::loadApps(['authentication']);
try {
// Always load authentication apps
OC_App::loadApps(['authentication']);
} catch (\OC\NeedsUpdateException $e) {
if ($isOccControllerRequested && $needUpgrade){
OC::$server->getRouter()->match(\OC::$server->getRequest()->getRawPathInfo());
return;
}
throw $e;
}
// Load minimum set of apps
if (!self::checkUpgrade(false)