Skip to content

Commit

Permalink
fix: change the place to load the maintenance theme
Browse files Browse the repository at this point in the history
  • Loading branch information
jvillafanez committed Mar 11, 2024
1 parent e4506a8 commit 67c8b89
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/base.php
Expand Up @@ -300,6 +300,9 @@ public static function checkMaintenanceMode(IRequest $request) {
&& OC::$SUBURI != '/core/ajax/update.php'
&& !$isOccControllerRequested
) {
// load the maintenance theme if any
\OC_App::loadMaintenanceTheme();

// send http status 503
\http_response_code(503);
\header('Status: 503 Service Temporarily Unavailable');
Expand Down
6 changes: 5 additions & 1 deletion lib/private/Route/Router.php
Expand Up @@ -273,7 +273,11 @@ public function match($url) {
} elseif (\substr($url, 0, 6) === '/core/' or \substr($url, 0, 10) === '/settings/') {
\OC::$REQUESTEDAPP = $url;
if (!Util::needUpgrade()) {
\OC_App::loadApps();
if (!\OC::$server->getConfig()->getSystemValue('maintenance', false)) {
\OC_App::loadApps();
} else {
\OC_App::loadMaintenanceTheme();
}
}
$this->loadRoutes('core');
} else {
Expand Down
1 change: 0 additions & 1 deletion lib/private/legacy/app.php
Expand Up @@ -122,7 +122,6 @@ public static function loadApps($types = null) {
}

if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) {
\OC_App::loadMaintenanceTheme();
return false;
}

Expand Down

0 comments on commit 67c8b89

Please sign in to comment.