Allow using json_row() in HTML

This commit is contained in:
Jakub Vrana 2013-07-12 11:12:57 -07:00
parent 352f29804e
commit be6b7c6cac

View file

@ -220,7 +220,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\"\\/") . '"' : 'undefined');
$first = false;
} else {
echo "\n}\n";