From be58b9cdbc54ef7abbc915ed3994a6644351903c Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Thu, 16 Dec 2010 07:02:51 +0100 Subject: [PATCH] Escape \n in JSON --- adminer/include/functions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index bf2e2819..cb92a789 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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";