Escape \n in JSON
This commit is contained in:
parent
991944e82b
commit
be58b9cdbc
|
@ -510,7 +510,7 @@ function json_row($key, $val = null) {
|
|||
echo "{";
|
||||
}
|
||||
if ($key != "") {
|
||||
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, '\\"') . '": ' . (isset($val) ? '"' . addcslashes($val, '\\"') . '"' : 'undefined');
|
||||
echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\"\\") . '": ' . (isset($val) ? '"' . addcslashes($val, "\r\n\"\\") . '"' : 'undefined');
|
||||
$first = false;
|
||||
} else {
|
||||
echo "\n}\n";
|
||||
|
|
Loading…
Reference in a new issue