aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorJosh Woody <a_jelly_doughnut@phpbb.com>2010-02-25 00:18:30 +0000
committerJosh Woody <a_jelly_doughnut@phpbb.com>2010-02-25 00:18:30 +0000
commit9e64c3bd84b9b595da54c6463e068ca8b84e1ee0 (patch)
treeaa85a67d44700125848069e2d68c2782a28aa9f3 /phpBB/includes/functions.php
parent8f5155d272f53c538d4a3df113207d57004e0bf2 (diff)
downloadforums-9e64c3bd84b9b595da54c6463e068ca8b84e1ee0.tar
forums-9e64c3bd84b9b595da54c6463e068ca8b84e1ee0.tar.gz
forums-9e64c3bd84b9b595da54c6463e068ca8b84e1ee0.tar.bz2
forums-9e64c3bd84b9b595da54c6463e068ca8b84e1ee0.tar.xz
forums-9e64c3bd84b9b595da54c6463e068ca8b84e1ee0.zip
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
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 364c8f4e9e..38f910974a 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -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'] == '.')
{