mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
[ticket/11997] Fix redirects from inside controllers
The redirect 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. PHPBB3-11997
This commit is contained in:
@@ -2662,6 +2662,16 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||
// Make sure no &'s are in, this will break the redirect
|
||||
$url = str_replace('&', '&', $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);
|
||||
|
||||
|
Reference in New Issue
Block a user