[ticket/12510] Convert & to & in build_url() when no params are stripped.

PHPBB3-12510
This commit is contained in:
Cesar G 2014-05-06 14:54:51 -07:00
parent 3c86a9bcca
commit eddb420375
2 changed files with 9 additions and 0 deletions

View file

@ -2356,6 +2356,10 @@ function build_url($strip_vars = false)
{ {
$redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false); $redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false);
} }
else
{
$redirect = str_replace('&', '&', $redirect);
}
return $redirect . ((strpos($redirect, '?') === false) ? '?' : ''); return $redirect . ((strpos($redirect, '?') === false) ? '?' : '');
} }

View file

@ -44,6 +44,11 @@ class phpbb_build_url_test extends phpbb_test_case
't', 't',
'phpBB/index.php?', 'phpBB/index.php?',
), ),
array(
'viewtopic.php?t=5&f=4',
false,
'phpBB/viewtopic.php?t=5&f=4',
),
array( array(
'viewtopic.php?f=2&style=1&t=6', 'viewtopic.php?f=2&style=1&t=6',
'f', 'f',