mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-19 07:08:09 +01:00
[feature/request-class] Prevent recursive_set_var from applying htmlspecialchars twice
PHPBB3-9716
This commit is contained in:
parent
204ee4714b
commit
55808e11c9
@ -176,7 +176,7 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i
|
|||||||
$this->set_var($k, $k, $key_type, $multibyte, $multibyte);
|
$this->set_var($k, $k, $key_type, $multibyte, $multibyte);
|
||||||
|
|
||||||
$this->recursive_set_var($v, $default_value, $multibyte);
|
$this->recursive_set_var($v, $default_value, $multibyte);
|
||||||
$this->set_var($var[$k], $v, $value_type, $multibyte);
|
$var[$k] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once 'test_framework/framework.php';
|
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_interface.php';
|
||||||
require_once '../phpBB/includes/request/type_cast_helper.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);
|
$this->assertEquals($expected, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_simple_recursive_set_var()
|
||||||
|
{
|
||||||
|
$data = 'eviL<3';
|
||||||
|
$expected = 'eviL<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<3');
|
||||||
|
|
||||||
|
$this->type_cast_helper->recursive_set_var($data, array(0 => ''), true);
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user