aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/version_helper.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2014-11-17 00:33:51 +0100
committerMarc Alexander <admin@m-a-styles.de>2014-11-21 22:32:28 +0100
commit4ee05b1c17fa1be0c911c9d37e106f19b23ebac2 (patch)
treed624f44ff799a824f926406ff0fdb763e1daa295 /phpBB/phpbb/version_helper.php
parent34004612acb0c55f1cf86271d5a62c1b396ee829 (diff)
downloadforums-4ee05b1c17fa1be0c911c9d37e106f19b23ebac2.tar
forums-4ee05b1c17fa1be0c911c9d37e106f19b23ebac2.tar.gz
forums-4ee05b1c17fa1be0c911c9d37e106f19b23ebac2.tar.bz2
forums-4ee05b1c17fa1be0c911c9d37e106f19b23ebac2.tar.xz
forums-4ee05b1c17fa1be0c911c9d37e106f19b23ebac2.zip
[ticket/security-171] Add tests for retrieved remote data in version_helper
SECURITY-171
Diffstat (limited to 'phpBB/phpbb/version_helper.php')
-rw-r--r--phpBB/phpbb/version_helper.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index 3c5f3efcf2..bcc67712e4 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -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']))
{