Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,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 @@ -852,8 +856,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