mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-08 17:56:52 +02:00
Bug #56965 - Allow redirect() to redirect across directories.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10536 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -2336,6 +2336,19 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
// Relative uri
|
||||
$pathinfo = pathinfo($url);
|
||||
|
||||
if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
|
||||
{
|
||||
$url = str_replace('../', '', $url);
|
||||
$pathinfo = pathinfo($url);
|
||||
|
||||
if (!file_exists($pathinfo['dirname']))
|
||||
{
|
||||
// fallback to "last known user page"
|
||||
$url = generate_board_url() . '/' . $user->page['page'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Is the uri pointing to the current directory?
|
||||
if ($pathinfo['dirname'] == '.')
|
||||
{
|
||||
|
Reference in New Issue
Block a user