File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -831,10 +831,14 @@ public static function handleRequest() {
831831 }
832832
833833 $ request = \OC ::$ server ->getRequest ();
834+ // Check if requested URL matches 'index.php/occ'
835+ $ isOccControllerRequested = preg_match ('|/index\.php$| ' , $ request ->getScriptName ()) === 1
836+ && strpos ($ request ->getPathInfo (), '/occ/ ' ) === 0 ;
837+
834838 $ requestPath = $ request ->getRawPathInfo ();
835839 if (substr ($ requestPath , -3 ) !== '.js ' ) { // we need these files during the upgrade
836840 self ::checkMaintenanceMode ($ request );
837- self ::checkUpgrade ();
841+ $ needUpgrade = self ::checkUpgrade (! $ isOccControllerRequested );
838842 }
839843
840844 // emergency app disabling
@@ -852,8 +856,16 @@ public static function handleRequest() {
852856 exit ();
853857 }
854858
855- // Always load authentication apps
856- OC_App::loadApps (['authentication ' ]);
859+ try {
860+ // Always load authentication apps
861+ OC_App::loadApps (['authentication ' ]);
862+ } catch (\OC \NeedsUpdateException $ e ) {
863+ if ($ isOccControllerRequested && $ needUpgrade ){
864+ OC ::$ server ->getRouter ()->match (\OC ::$ server ->getRequest ()->getRawPathInfo ());
865+ return ;
866+ }
867+ throw $ e ;
868+ }
857869
858870 // Load minimum set of apps
859871 if (!self ::checkUpgrade (false )
You can’t perform that action at this time.
0 commit comments