]> git.joonet.de Git - adminer.git/commitdiff
Escape \n in JSON
authorJakub Vrana <jakub@vrana.cz>
Thu, 16 Dec 2010 06:02:51 +0000 (07:02 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 16 Dec 2010 21:52:03 +0000 (22:52 +0100)
adminer/include/functions.inc.php

index bf2e2819f3aba2d60ba625f9bc3707b46c6a3e89..cb92a7893e5d5eaf8d40e42d163f82346e33ee0f 100644 (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";