From 5ec1c887959be5629c8a4c712b152d58058929a8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 25 Nov 2010 23:29:12 +0100 Subject: [PATCH] [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 --- phpBB/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 561a9906c4..c7f19b709d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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