1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 07:07:51 +02:00

[ticket/9930] Redirect failes with open_basedir enabled.

Open_basedir does not allow file_exists() for "." and directories without a
trayling-slash. Therefor we must append it on the check.

PHPBB3-9930
This commit is contained in:
Joas Schilling 2010-11-25 23:29:12 +01:00
parent f204ce6825
commit 5ec1c88795

View File

@ -2353,12 +2353,12 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Relative uri
$pathinfo = pathinfo($url);
if (!$disable_cd_check && !file_exists($pathinfo['dirname']))
if (!$disable_cd_check && !file_exists($pathinfo['dirname'] . '/'))
{
$url = str_replace('../', '', $url);
$pathinfo = pathinfo($url);
if (!file_exists($pathinfo['dirname']))
if (!file_exists($pathinfo['dirname'] . '/'))
{
// fallback to "last known user page"
// at least this way we know the user does not leave the phpBB root