diff options
Diffstat (limited to 'tests/functions/build_url_test.php')
-rw-r--r-- | tests/functions/build_url_test.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php index df178f277e..5cfd1300de 100644 --- a/tests/functions/build_url_test.php +++ b/tests/functions/build_url_test.php @@ -69,6 +69,11 @@ class phpbb_build_url_test extends phpbb_test_case array('f', 'style', 't'), 'http://test.phpbb.com/viewtopic.php?', ), + array( + 'posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E', + false, + 'phpBB/posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E', + ) ); } @@ -79,16 +84,10 @@ class phpbb_build_url_test extends phpbb_test_case { global $user, $phpbb_root_path; - $user->page['page'] = str_replace('%2F', '/', urlencode($this->sanitizer($page))); + $user->page['page'] = $page; + $output = build_url($strip_vars); $this->assertEquals($expected, $output); } - - protected function sanitizer($value) - { - $type_cast_helper = new \phpbb\request\type_cast_helper(); - $type_cast_helper->set_var($value, $value, gettype($value), true); - return $value; - } } |