1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-10 00:28:34 +02:00

Escape \n in JSON

This commit is contained in:
Jakub Vrana
2010-12-16 07:02:51 +01:00
parent 991944e82b
commit be58b9cdbc

View File

@@ -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";