1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[ticket/10824] Add json sanitizer class

PHPBB3-10824
This commit is contained in:
Marc Alexander
2016-01-16 18:51:13 +01:00
parent 8244aff9cb
commit 04e791d9fe
3 changed files with 43 additions and 11 deletions

View File

@@ -389,17 +389,8 @@ class version_helper
throw new version_check_exception($error_string);
}
$info = json_decode($info, true);
// Sanitize any data we retrieve from a server
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);
}
$info = \phpbb\json_sanitizer::sanitize(json_decode($info, true));
if (empty($info['stable']) && empty($info['unstable']))
{