From dedbd01f64562b97079cead25d69c7e8f1eff9af Mon Sep 17 00:00:00 2001 From: Janne Cederberg Date: Thu, 7 Jul 2016 15:34:59 +0300 Subject: [PATCH] Tabs must also be escaped in JSON strings If database table data contains tab characters (0x09) then those must also be escaped along with newlines and carriage returns for the resulting JSON file to be valid. --- 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 8b97138d..9756cd91 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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\"\\/") . '"' : 'null'); + echo ($first ? "" : ",") . "\n\t\"" . addcslashes($key, "\r\n\t\"\\/") . '": ' . ($val !== null ? '"' . addcslashes($val, "\r\n\"\\/") . '"' : 'null'); $first = false; } else { echo "\n}\n";