From cd4fbe1fbaab690953d9dbb5357da0832239cee4 Mon Sep 17 00:00:00 2001 From: BennyBPB Date: Sun, 11 Jun 2023 18:15:07 +0200 Subject: [PATCH] Change current directory only if necessary --- public/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/index.php b/public/index.php index d49672c6d1e7..a6d943a9d861 100644 --- a/public/index.php +++ b/public/index.php @@ -16,7 +16,9 @@ define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR); // Ensure the current directory is pointing to the front controller's directory -chdir(FCPATH); +if (getcwd() . DIRECTORY_SEPARATOR !== FCPATH) { + chdir(FCPATH); +} /* *---------------------------------------------------------------