1
0
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:
Marc Alexander
2014-11-17 00:33:51 +01:00
parent 34004612ac
commit 4ee05b1c17
2 changed files with 189 additions and 5 deletions

View File

@@ -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']))
{