aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2010-09-19 15:31:00 +0200
committerIgor Wiedler <igor@wiedler.ch>2010-09-19 15:31:00 +0200
commit55808e11c987b72b6c2d364d4f17e11dfbbebc71 (patch)
tree683c270d30b4b31c5918efabc5e85236ac7065c6 /tests/request
parent[feature/request-class] Removal of direct access to some superglobals (diff)
downloadphpbb-55808e11c987b72b6c2d364d4f17e11dfbbebc71.tar.gz
phpbb-55808e11c987b72b6c2d364d4f17e11dfbbebc71.tar.bz2
phpbb-55808e11c987b72b6c2d364d4f17e11dfbbebc71.zip
[feature/request-class] Prevent recursive_set_var from applying htmlspecialchars twice
PHPBB3-9716
Diffstat (limited to 'tests/request')
-rw-r--r--tests/request/type_cast_helper.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/request/type_cast_helper.php b/tests/request/type_cast_helper.php
index 51687c186d..291b414fd3 100644
--- a/tests/request/type_cast_helper.php
+++ b/tests/request/type_cast_helper.php
@@ -9,6 +9,7 @@
*/
require_once 'test_framework/framework.php';
+require_once '../phpBB/includes/utf/utf_tools.php';
require_once '../phpBB/includes/request/type_cast_helper_interface.php';
require_once '../phpBB/includes/request/type_cast_helper.php';
@@ -30,4 +31,24 @@ class phpbb_type_cast_helper_test extends phpbb_test_case
$this->assertEquals($expected, $data);
}
+
+ public function test_simple_recursive_set_var()
+ {
+ $data = 'eviL<3';
+ $expected = 'eviL&lt;3';
+
+ $this->type_cast_helper->recursive_set_var($data, '', true);
+
+ $this->assertEquals($expected, $data);
+ }
+
+ public function test_nested_recursive_set_var()
+ {
+ $data = array('eviL<3');
+ $expected = array('eviL&lt;3');
+
+ $this->type_cast_helper->recursive_set_var($data, array(0 => ''), true);
+
+ $this->assertEquals($expected, $data);
+ }
}