diff --git a/misuzu.php b/misuzu.php index cc6dd6a0..529f74ae 100644 --- a/misuzu.php +++ b/misuzu.php @@ -138,6 +138,15 @@ if(!mb_check_encoding()) { ob_start(); +if(file_exists(MSZ_ROOT . '/.migrating')) { + http_response_code(503); + if(!isset($_GET['_check'])) { + header('Content-Type: text/html; charset-utf-8'); + echo file_get_contents(MSZ_ROOT . '/templates/503.html'); + } + exit; +} + if(!is_readable(MSZ_STORAGE) || !is_writable(MSZ_STORAGE)) { echo 'Cannot access storage directory.'; exit; @@ -161,15 +170,6 @@ Template::set('globals', [ Template::addPath(MSZ_ROOT . '/templates'); -if(file_exists(MSZ_ROOT . '/.migrating')) { - http_response_code(503); - if(!isset($_GET['_check'])) { - header('Content-Type: text/html; charset-utf-8'); - echo file_get_contents(MSZ_ROOT . '/templates/503.html'); - } - exit; -} - if(isset($_COOKIE['msz_uid']) && isset($_COOKIE['msz_sid'])) { $authToken = (new AuthToken) ->setUserId(filter_input(INPUT_COOKIE, 'msz_uid', FILTER_SANITIZE_NUMBER_INT) ?? 0)