diff options
Diffstat (limited to 'tests/mock/request.php')
-rw-r--r-- | tests/mock/request.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/mock/request.php b/tests/mock/request.php index 304fcf0eaf..e7217a94a9 100644 --- a/tests/mock/request.php +++ b/tests/mock/request.php @@ -114,4 +114,25 @@ class phpbb_mock_request implements \phpbb\request\request_interface { $this->data[$super_global] = array_merge($this->data[$super_global], $values); } + + public function escape($var, $multibyte) + { + $type_cast_helper = new \phpbb\request\type_cast_helper(); + if (is_array($var)) + { + $result = array(); + foreach ($var as $key => $value) + { + $type_cast_helper->set_var($key, $key, gettype($key), $multibyte); + $result[$key] = $this->escape($value, $multibyte); + } + $var = $result; + } + else + { + $type_cast_helper->set_var($var, $var, 'string', $multibyte); + } + + return $var; + } } |