Merge pull request #25356 from owncloud/checkupgrade-bypass
Bypass upgrade page when occ controller is requested
This commit is contained in:
commit
e668cf1a33
14
lib/base.php
14
lib/base.php
|
@ -831,10 +831,14 @@ class OC {
|
||||||
}
|
}
|
||||||
|
|
||||||
$request = \OC::$server->getRequest();
|
$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();
|
$requestPath = $request->getRawPathInfo();
|
||||||
if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
|
if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
|
||||||
self::checkMaintenanceMode($request);
|
self::checkMaintenanceMode($request);
|
||||||
self::checkUpgrade();
|
$needUpgrade = self::checkUpgrade(!$isOccControllerRequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
// emergency app disabling
|
// emergency app disabling
|
||||||
|
@ -852,8 +856,16 @@ class OC {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// Always load authentication apps
|
// Always load authentication apps
|
||||||
OC_App::loadApps(['authentication']);
|
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
|
// Load minimum set of apps
|
||||||
if (!self::checkUpgrade(false)
|
if (!self::checkUpgrade(false)
|
||||||
|
|
Loading…
Reference in New Issue