Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVicDeo <dubiniuk@owncloud.com>2016-07-06 23:08:58 +0300
committerThomas Müller <DeepDiver1975@users.noreply.github.com>2016-07-06 23:08:58 +0300
commit445a76bb1b0249a642a9a3f2e400c1221be7993f (patch)
tree0963d0124d92102d7310f80f32c7714c484e90f9 /lib
parentad67b3f0b068b1d997612449f9f87eddbd31e790 (diff)
Bypass upgrade page when occ controller is requested (#25363)
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index 07d8f3b788b..1a6d1b8d3f6 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -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)