From 414327dc7071a9d9c94ed3d8fabbe5d83a978a5a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 1 Jan 2019 16:50:38 +0100 Subject: [PATCH] [ticket/10824] Make sure to always return array from decode method PHPBB3-10824 --- phpBB/phpbb/json_sanitizer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/json_sanitizer.php b/phpBB/phpbb/json_sanitizer.php index 157502624f..8d6937e630 100644 --- a/phpBB/phpbb/json_sanitizer.php +++ b/phpBB/phpbb/json_sanitizer.php @@ -50,6 +50,7 @@ class json_sanitizer */ static public function decode($json) { - return self::sanitize(json_decode($json, true)); + $data = json_decode($json, true); + return !empty($data) ? self::sanitize($data) : []; } }