mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-01 20:19:13 +02:00
[ticket/17201] Add dot for improved dirname for URI ending in slash
PHPBB3-17201
This commit is contained in:
parent
70ba9dac03
commit
607a2c483a
@ -57,8 +57,10 @@ if (!defined('PHPBB_INSTALLED'))
|
|||||||
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
|
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$script_name = substr($script_name, -1) === '/' ? $script_name . '.' : $script_name;
|
||||||
|
|
||||||
// $phpbb_root_path accounts for redirects from e.g. /adm
|
// $phpbb_root_path accounts for redirects from e.g. /adm
|
||||||
$script_path = trim(substr($script_name, -1) !== '/' ? dirname($script_name) : $script_name) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
|
$script_path = trim(dirname($script_name)) . '/' . $phpbb_root_path . 'install/app.' . $phpEx;
|
||||||
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
// Replace any number of consecutive backslashes and/or slashes with a single slash
|
||||||
// (could happen on some proxy setups and/or Windows servers)
|
// (could happen on some proxy setups and/or Windows servers)
|
||||||
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
$script_path = preg_replace('#[\\\\/]{2,}#', '/', $script_path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user