mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 05:38:52 +00:00
[ticket/develop/11832] Fix path detection
Clean up path, do not count first / PHPBB3-11832
This commit is contained in:
parent
dd86e8d0ae
commit
07632d46fc
1 changed files with 7 additions and 1 deletions
|
@ -5733,6 +5733,8 @@ function phpbb_create_symfony_request(phpbb_request $request)
|
|||
*/
|
||||
function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = '')
|
||||
{
|
||||
global $phpbb_container;
|
||||
|
||||
static $path;
|
||||
if (null !== $path)
|
||||
{
|
||||
|
@ -5746,7 +5748,11 @@ function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = ''
|
|||
return $path;
|
||||
}
|
||||
|
||||
$corrections = substr_count($path_info, '/');
|
||||
$filesystem = $phpbb_container->get('filesystem');
|
||||
$path_info = $filesystem->clean_path($path_info);
|
||||
|
||||
// Do not count / at start of path
|
||||
$corrections = substr_count(substr($path_info, 1), '/');
|
||||
|
||||
// When URL Rewriting is enabled, app.php is optional. We have to
|
||||
// correct for it not being there
|
||||
|
|
Loading…
Add table
Reference in a new issue