diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-08-01 13:52:37 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-08-01 13:52:37 +0000 |
commit | 73a6f7263b02ed694d986967a162f2359f89f709 (patch) | |
tree | 8827473a05aa23b672eff26e2739d003b8c0d001 /phpBB/includes/functions.php | |
parent | 79406749622b816f569212ba89af1e27d1a7a772 (diff) | |
download | forums-73a6f7263b02ed694d986967a162f2359f89f709.tar forums-73a6f7263b02ed694d986967a162f2359f89f709.tar.gz forums-73a6f7263b02ed694d986967a162f2359f89f709.tar.bz2 forums-73a6f7263b02ed694d986967a162f2359f89f709.tar.xz forums-73a6f7263b02ed694d986967a162f2359f89f709.zip |
Adjust build_url() to not prepend $phpbb_root_path if path returned from redirect() is an URL. This fixes redirect issues with some installations and bridges. (Bug #47535)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9907 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 241bed408f..d147872c34 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2284,7 +2284,7 @@ function redirect($url, $return = false, $disable_cd_check = false) $url = str_replace('&', '&', $url); // Determine which type of redirect we need to handle... - $url_parts = parse_url($url); + $url_parts = @parse_url($url); if ($url_parts === false) { @@ -2497,6 +2497,18 @@ function build_url($strip_vars = false) $redirect .= ($query) ? '?' . $query : ''; } + // We need to be cautious here. + // On some situations, the redirect path is an absolute URL, sometimes a relative path + // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location, + // else we use the URL directly. + $url_parts = @parse_url($redirect); + + // URL + if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host'])) + { + return str_replace('&', '&', $redirect); + } + return $phpbb_root_path . str_replace('&', '&', $redirect); } @@ -3596,7 +3608,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) exit_handler(); break; - + // PHP4 comptibility case E_DEPRECATED: return true; |