1
0
Fork 0

Merge pull request #3827 from fonsecas72/fix_test_php7

Make parseJson safer
pull/3828/head
Jordi Boggiano 2015-03-08 12:01:37 +00:00
commit 8956c34da6
1 changed files with 3 additions and 0 deletions

View File

@ -253,6 +253,9 @@ class JsonFile
*/
public static function parseJson($json, $file = null)
{
if (null === $json) {
return;
}
$data = json_decode($json, true);
if (null === $data && JSON_ERROR_NONE !== json_last_error()) {
self::validateSyntax($json, $file);