diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-07-05 12:04:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-05 12:04:19 +0200 |
commit | 563c895a4684322227fa3b9df5435d2ff19d034d (patch) | |
tree | 78a05b684675f2ae2a832e4ef3f0eaeaa4946d26 /lib | |
parent | b77fcc19d4fe26841a54c742cb319595ea84f771 (diff) | |
parent | e38bbdc9fec95c77b9a307eab3fe5ff538b86b5d (diff) | |
download | nextcloud-server-563c895a4684322227fa3b9df5435d2ff19d034d.tar.gz nextcloud-server-563c895a4684322227fa3b9df5435d2ff19d034d.zip |
Merge pull request #25356 from owncloud/checkupgrade-bypass
Bypass upgrade page when occ controller is requested
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php index 45f291e5cb7..54f865b2cad 100644 --- a/lib/base.php +++ b/lib/base.php @@ -831,10 +831,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 @@ -852,8 +856,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) |