diff options
author | Marc Alexander <admin@m-a-styles.de> | 2014-11-03 17:14:18 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2014-11-03 17:27:01 +0100 |
commit | 13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5 (patch) | |
tree | e9b81e6fce3e55ad107081e6450440bedcbd443c /tests/functions | |
parent | 6fd092b5df6f96530fec8ba1aec426b6d59b822b (diff) | |
download | forums-13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5.tar forums-13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5.tar.gz forums-13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5.tar.bz2 forums-13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5.tar.xz forums-13b59af1ffd0af652ba0ce3bc3f2594fc448fdb5.zip |
[ticket/13280] Add additional sanitizer for ampersands in server superglobal
PHPBB3-13280
Diffstat (limited to 'tests/functions')
-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; - } } |