mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/security-171] Add tests for retrieved remote data in version_helper
SECURITY-171
This commit is contained in:
@@ -260,11 +260,14 @@ class version_helper
|
||||
$info = json_decode($info, true);
|
||||
|
||||
// Sanitize any data we retrieve from a server
|
||||
$json_sanitizer = function(&$value, $key) {
|
||||
$type_cast_helper = new \phpbb\request\type_cast_helper();
|
||||
$type_cast_helper->set_var($value, $value, gettype($value), true);
|
||||
};
|
||||
array_walk_recursive($info, $json_sanitizer);
|
||||
if (!empty($info))
|
||||
{
|
||||
$json_sanitizer = function (&$value, $key) {
|
||||
$type_cast_helper = new \phpbb\request\type_cast_helper();
|
||||
$type_cast_helper->set_var($value, $value, gettype($value), true);
|
||||
};
|
||||
array_walk_recursive($info, $json_sanitizer);
|
||||
}
|
||||
|
||||
if (empty($info['stable']) && empty($info['unstable']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user