aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2013-11-13 07:34:40 -0800
committerMarc Alexander <admin@m-a-styles.de>2013-11-13 07:34:40 -0800
commit27ae58713b8468ce7dce19ea4dda60f924467fc0 (patch)
tree564bb46bed42f8e537d13f02049ded1bfde2b573 /phpBB/includes/functions.php
parentd43542a434c6a214c7533f76f3b1dc7afe84e5cf (diff)
parenta0fca0acc24684615d123d71ce696e43ba4e2615 (diff)
downloadforums-27ae58713b8468ce7dce19ea4dda60f924467fc0.tar
forums-27ae58713b8468ce7dce19ea4dda60f924467fc0.tar.gz
forums-27ae58713b8468ce7dce19ea4dda60f924467fc0.tar.bz2
forums-27ae58713b8468ce7dce19ea4dda60f924467fc0.tar.xz
forums-27ae58713b8468ce7dce19ea4dda60f924467fc0.zip
Merge pull request #4 from nickvergessen/ticket/marc/11997
Ticket/marc/11997
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 0a10a9604c..a6c03098c2 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2645,7 +2645,7 @@ function generate_board_url($without_script_path = false)
*/
function redirect($url, $return = false, $disable_cd_check = false)
{
- global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem;
+ global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem, $phpbb_path_helper;
$failover_flag = false;
@@ -2662,6 +2662,16 @@ function redirect($url, $return = false, $disable_cd_check = false)
// Make sure no &amp;'s are in, this will break the redirect
$url = str_replace('&amp;', '&', $url);
+ // The url currently uses the web root path.
+ // However as we prepend the full board url later,
+ // we need to remove the relative web root path and
+ // prepend the normal root path again. Otherwise redirects
+ // from inside routes will not work as intended.
+ if ($phpbb_path_helper instanceof \phpbb\path_helper)
+ {
+ $url = $phpbb_path_helper->remove_web_root_path($url);
+ }
+
// Determine which type of redirect we need to handle...
$url_parts = @parse_url($url);