From: Janne Cederberg Date: Thu, 7 Jul 2016 12:34:59 +0000 (+0300) Subject: Tabs must also be escaped in JSON strings X-Git-Tag: v4.3.0~61 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=dedbd01f64562b97079cead25d69c7e8f1eff9af;p=adminer.git 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. --- 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";