1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 19:24:01 +02:00

Merge branch '3.2.x'

This commit is contained in:
Máté Bartus
2017-09-09 12:09:50 +02:00
4 changed files with 44 additions and 6 deletions

View File

@@ -93,9 +93,18 @@ class session
$page_name .= str_replace('%2F', '/', urlencode($symfony_request_path));
}
// current directory within the phpBB root (for example: adm)
$root_dirs = explode('/', str_replace('\\', '/', filesystem_helper::realpath($root_path)));
$page_dirs = explode('/', str_replace('\\', '/', filesystem_helper::realpath('./')));
if (substr($root_path, 0, 2) === './' && strpos($root_path, '..') === false)
{
$root_dirs = explode('/', str_replace('\\', '/', rtrim($root_path, '/')));
$page_dirs = explode('/', str_replace('\\', '/', '.'));
}
else
{
// current directory within the phpBB root (for example: adm)
$root_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath($root_path)));
$page_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath('./')));
}
$intersection = array_intersect_assoc($root_dirs, $page_dirs);
$root_dirs = array_diff_assoc($root_dirs, $intersection);