[ticket/17201] Add comment on need to add dot to script_name

PHPBB3-17201
This commit is contained in:
Marc Alexander 2023-10-29 16:54:07 +01:00
parent 593c4b875c
commit 58fc9e042a
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -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