1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-23 08:43:02 +02:00

[ticket/13280] Output escaping for the symfony request object

PHPBB3-13280
This commit is contained in:
Tristan Darricau
2014-11-12 11:44:56 +01:00
parent 526a97db7c
commit 0dfe1d0d8b
12 changed files with 116 additions and 56 deletions

View File

@@ -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;
}
}