diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3480a338c0..a0e2a46f54 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2356,6 +2356,10 @@ function build_url($strip_vars = false) { $redirect = $phpbb_path_helper->strip_url_params($redirect, $strip_vars, false); } + else + { + $redirect = str_replace('&', '&', $redirect); + } return $redirect . ((strpos($redirect, '?') === false) ? '?' : ''); } diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php index 795427ffe8..ad36f29b8c 100644 --- a/tests/functions/build_url_test.php +++ b/tests/functions/build_url_test.php @@ -44,6 +44,11 @@ class phpbb_build_url_test extends phpbb_test_case 't', 'phpBB/index.php?', ), + array( + 'viewtopic.php?t=5&f=4', + false, + 'phpBB/viewtopic.php?t=5&f=4', + ), array( 'viewtopic.php?f=2&style=1&t=6', 'f',