Skip to content

Commit

Permalink
Bypass upgrade page when occ controller is requested (#25363)
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo authored and DeepDiver1975 committed Jul 6, 2016
1 parent ad67b3f commit 445a76b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,14 @@ public static function handleRequest() {
}

$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
Expand All @@ -868,8 +872,16 @@ public static function handleRequest() {
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)
Expand Down

0 comments on commit 445a76b

Please sign in to comment.