mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/13280] Output escaping for the symfony request object
PHPBB3-13280
This commit is contained in:
@@ -13,12 +13,13 @@
|
||||
|
||||
class phpbb_mock_controller_helper extends \phpbb\controller\helper
|
||||
{
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
|
||||
{
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->config = $config;
|
||||
$this->symfony_request = $symfony_request;
|
||||
$this->request = $request;
|
||||
$this->filesystem = $filesystem;
|
||||
$this->phpbb_root_path = $phpbb_root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user