diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-22 15:15:20 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-03-22 15:15:20 +0000 |
commit | 3ff475bcbba49cf55e7f4e803f7d16f7b0c93759 (patch) | |
tree | 493b39b0d9ccc9790bf9fe93ddacd7caf71f6477 /phpBB/includes/functions.php | |
parent | d8013e9c75eed6f9aed156029685c7bfb0fc9252 (diff) | |
download | forums-3ff475bcbba49cf55e7f4e803f7d16f7b0c93759.tar forums-3ff475bcbba49cf55e7f4e803f7d16f7b0c93759.tar.gz forums-3ff475bcbba49cf55e7f4e803f7d16f7b0c93759.tar.bz2 forums-3ff475bcbba49cf55e7f4e803f7d16f7b0c93759.tar.xz forums-3ff475bcbba49cf55e7f4e803f7d16f7b0c93759.zip |
some fixes... hopefully not breaking something. :o
git-svn-id: file:///svn/phpbb/trunk@7216 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 31667358f3..b281ced615 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1693,19 +1693,20 @@ function redirect($url, $return = false) // Is the uri pointing to the current directory? if ($pathinfo['dirname'] == '.') { + $url = str_replace('./', '', $url); + + // Strip / from the beginning + if ($url && substr($url, 0, 1) == '/') + { + $url = substr($url, 1); + } + if ($user->page['page_dir']) { - $url = generate_board_url() . '/' . $user->page['page_dir'] . '/' . str_replace('./', '', $url); + $url = generate_board_url() . '/' . $user->page['page_dir'] . '/' . $url; } else { - $url = str_replace('./', '', $url); - - if ($url && substr($url, -1, 1) == '/') - { - $url = substr($url, 0, -1); - } - $url = generate_board_url() . '/' . $url; } } @@ -1721,12 +1722,27 @@ function redirect($url, $return = false) $dir = str_repeat('../', sizeof($root_dirs)) . implode('/', $page_dirs); + // Strip / from the end if ($dir && substr($dir, -1, 1) == '/') { $dir = substr($dir, 0, -1); } - $url = $dir . '/' . str_replace($pathinfo['dirname'] . '/', '', $url); + // Strip / from the beginning + if ($dir && substr($dir, 0, 1) == '/') + { + $dir = substr($dir, 1); + } + + $url = str_replace($pathinfo['dirname'] . '/', '', $url); + + // Strip / from the beginning + if (substr($url, 0, 1) == '/') + { + $url = substr($url, 1); + } + + $url = $dir . '/' . $url; $url = generate_board_url() . '/' . $url; } } @@ -3592,6 +3608,10 @@ function msg_handler($errno, $msg_text, $errfile, $errline) exit; break; + + case E_RECOVERABLE_ERROR: + return false; + break; } } |