Changed 'undefined' to 'null'

'undefined' is not a valid JSON attribute value and should been 'null'
This commit is contained in:
shaununderwood 2016-10-23 20:23:38 +01:00 committed by Jakub Vrana
parent d0268c69da
commit 3a1c251065

View file

@ -243,7 +243,7 @@ function json_row($key, $val = null) {
echo "{";
}
if ($key != "") {
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'undefined');
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null');
$first = false;
} else {
echo "\n}\n";