File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -847,10 +847,14 @@ public static function handleRequest() {
847847 }
848848
849849 $ request = \OC ::$ server ->getRequest ();
850+ // Check if requested URL matches 'index.php/occ'
851+ $ isOccControllerRequested = preg_match ('|/index\.php$| ' , $ request ->getScriptName ()) === 1
852+ && strpos ($ request ->getPathInfo (), '/occ/ ' ) === 0 ;
853+
850854 $ requestPath = $ request ->getRawPathInfo ();
851855 if (substr ($ requestPath , -3 ) !== '.js ' ) { // we need these files during the upgrade
852856 self ::checkMaintenanceMode ($ request );
853- self ::checkUpgrade ();
857+ $ needUpgrade = self ::checkUpgrade (! $ isOccControllerRequested );
854858 }
855859
856860 // emergency app disabling
@@ -868,8 +872,16 @@ public static function handleRequest() {
868872 exit ();
869873 }
870874
871- // Always load authentication apps
872- OC_App::loadApps (['authentication ' ]);
875+ try {
876+ // Always load authentication apps
877+ OC_App::loadApps (['authentication ' ]);
878+ } catch (\OC \NeedsUpdateException $ e ) {
879+ if ($ isOccControllerRequested && $ needUpgrade ){
880+ OC ::$ server ->getRouter ()->match (\OC ::$ server ->getRequest ()->getRawPathInfo ());
881+ return ;
882+ }
883+ throw $ e ;
884+ }
873885
874886 // Load minimum set of apps
875887 if (!self ::checkUpgrade (false )
You can’t perform that action at this time.
0 commit comments