mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 15:57:45 +02:00
[ticket/16207] Stop appending ? to build_url URLs if not needed
PHPBB3-16207
This commit is contained in:
@@ -1835,7 +1835,7 @@ function build_url($strip_vars = false)
|
|||||||
$redirect = str_replace('&', '&', $redirect);
|
$redirect = str_replace('&', '&', $redirect);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $redirect . ((strpos($redirect, '?') === false) ? '?' : '');
|
return $redirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -39,12 +39,12 @@ class phpbb_build_url_test extends phpbb_test_case
|
|||||||
array(
|
array(
|
||||||
'index.php',
|
'index.php',
|
||||||
false,
|
false,
|
||||||
'phpBB/index.php?',
|
'phpBB/index.php',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'index.php',
|
'index.php',
|
||||||
't',
|
't',
|
||||||
'phpBB/index.php?',
|
'phpBB/index.php',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'viewtopic.php?t=5&f=4',
|
'viewtopic.php?t=5&f=4',
|
||||||
@@ -59,12 +59,12 @@ class phpbb_build_url_test extends phpbb_test_case
|
|||||||
array(
|
array(
|
||||||
'viewtopic.php?f=2&style=1&t=6',
|
'viewtopic.php?f=2&style=1&t=6',
|
||||||
array('f', 'style', 't'),
|
array('f', 'style', 't'),
|
||||||
'phpBB/viewtopic.php?',
|
'phpBB/viewtopic.php',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'http://test.phpbb.com/viewtopic.php?f=2&style=1&t=6',
|
'http://test.phpbb.com/viewtopic.php?f=2&style=1&t=6',
|
||||||
array('f', 'style', 't'),
|
array('f', 'style', 't'),
|
||||||
'http://test.phpbb.com/viewtopic.php?',
|
'http://test.phpbb.com/viewtopic.php',
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
|
'posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
|
||||||
|
Reference in New Issue
Block a user