From 070cc4c5025e7646cc6b032e9114413c9f6ca8d5 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 7 Dec 2020 11:18:50 +0100 Subject: [PATCH] Internal: Install: Auto-redirect to install script if not subdirectory --- public/index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/index.php b/public/index.php index f235b6705b..19e5e108fb 100644 --- a/public/index.php +++ b/public/index.php @@ -25,7 +25,13 @@ if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { Request::setTrustedHosts([$trustedHosts]); } + $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']); +if (empty($_ENV['APP_INSTALLED']) or $_ENV['APP_INSTALLED'] == '{{APP_INSTALLED}}') { + // Does not support subdirectories for now + header('Location: /main/install/index.php'); + exit; +} $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send();