diff --git a/phpBB/common.php b/phpBB/common.php index 4ce3ba8a64..088be276a5 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -58,7 +58,7 @@ if (!defined('PHPBB_INSTALLED')) } // $phpbb_root_path accounts for redirects from e.g. /adm - $script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx; + $script_path = trim(substr($script_name, -1) !== '/' ? dirname($script_name) : $script_name) . '/' . $phpbb_root_path . 'install/app.' . $phpEx; // Replace any number of consecutive backslashes and/or slashes with a single slash // (could happen on some proxy setups and/or Windows servers) $script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);