From 58fc9e042a9eac604a549a6d19bbf4e19bf1b5c9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 29 Oct 2023 16:54:07 +0100 Subject: [PATCH] [ticket/17201] Add comment on need to add dot to script_name PHPBB3-17201 --- phpBB/includes/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c5bab68d3c0..17b3eda34e4 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1829,6 +1829,7 @@ function phpbb_get_install_redirect(string $phpbb_root_path, string $phpEx): str $script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); } + // Add trailing dot to prevent dirname() from returning parent directory if $script_name is a directory $script_name = substr($script_name, -1) === '/' ? $script_name . '.' : $script_name; // $phpbb_root_path accounts for redirects from e.g. /adm