From 4c37172f6072486e2dce8b51464d44d96d57da0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Dufraisse?= Date: Mon, 27 Feb 2023 10:52:08 +0100 Subject: [PATCH] fix(rewrite): simplify index.php content to emulate rewrite --- content/index.php | 4 ---- content/sub/index.php | 6 +----- content/sub/page/index.php | 6 +----- content/theme/index.php | 4 ---- sites/default/index.php | 4 +--- sites/default/sub/index.php | 8 ++++++++ sites/default/sub/page/index.php | 8 ++++++++ sites/default/theme/index.php | 8 ++++++++ 8 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 sites/default/sub/index.php create mode 100644 sites/default/sub/page/index.php create mode 100644 sites/default/theme/index.php diff --git a/content/index.php b/content/index.php index d2d77af..cf8e8c0 100644 --- a/content/index.php +++ b/content/index.php @@ -5,8 +5,4 @@ * Authors: see /README.md */ chdir(dirname(__DIR__,1)); -$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1; -$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],1).'/index.php'; -$_SERVER['QUERY_STRING'] = '&' . ($_SERVER['QUERY_STRING'] ?? '') ; -$_SERVER['PICO_URL_REWRITING'] = true; include 'index.php'; diff --git a/content/sub/index.php b/content/sub/index.php index 9209c7f..b099173 100644 --- a/content/sub/index.php +++ b/content/sub/index.php @@ -5,8 +5,4 @@ * Authors: see /README.md */ chdir(dirname(__DIR__,2)); -$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1; -$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],2).'/index.php'; -$_SERVER['QUERY_STRING'] = 'sub&' . ($_SERVER['QUERY_STRING'] ?? '') ; -$_SERVER['PICO_URL_REWRITING'] = true; -include 'index.php'; +include 'index.php'; \ No newline at end of file diff --git a/content/sub/page/index.php b/content/sub/page/index.php index 09b69b4..4a08037 100644 --- a/content/sub/page/index.php +++ b/content/sub/page/index.php @@ -5,8 +5,4 @@ * Authors: see /README.md */ chdir(dirname(__DIR__,3)); -$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1; -$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],3).'/index.php'; -$_SERVER['QUERY_STRING'] = 'page&' . ($_SERVER['QUERY_STRING'] ?? '') ; -$_SERVER['PICO_URL_REWRITING'] = true; -include 'index.php'; +include 'index.php'; \ No newline at end of file diff --git a/content/theme/index.php b/content/theme/index.php index c26e9fc..4bee5d9 100644 --- a/content/theme/index.php +++ b/content/theme/index.php @@ -5,8 +5,4 @@ * Authors: see /README.md */ chdir(dirname(__DIR__,2)); -$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 1; -$_SERVER['SCRIPT_NAME'] = dirname($_SERVER['SCRIPT_NAME'],2).'/index.php'; -$_SERVER['QUERY_STRING'] = 'theme&' . ($_SERVER['QUERY_STRING'] ?? '') ; -$_SERVER['PICO_URL_REWRITING'] = true; include 'index.php'; diff --git a/sites/default/index.php b/sites/default/index.php index b2475d8..913df9c 100644 --- a/sites/default/index.php +++ b/sites/default/index.php @@ -6,9 +6,7 @@ */ chdir(dirname(__DIR__,2)); -$GLOBALS['PicoVendorsDirectoryRelativeLevels'] = 2; - - if (is_file('vendor/autoload.php')) { +if (is_file('vendor/autoload.php')) { include_once('vendor/autoload.php'); } diff --git a/sites/default/sub/index.php b/sites/default/sub/index.php new file mode 100644 index 0000000..95b4a5c --- /dev/null +++ b/sites/default/sub/index.php @@ -0,0 +1,8 @@ +