always properly escape double quotes

This commit is contained in:
Max Ogden 2011-06-15 20:31:29 -07:00
parent f10cfd9acf
commit 25db477531

View File

@ -19,8 +19,8 @@ function(head, req) {
if (row.value[headers[header]]) {
if (startedOutput) send(",");
var value = row.value[headers[header]];
if (typeof(value) == "object") value = JSON.stringify(value).replace(/\"/g, '""');
send("\"" + value + "\"");
if (typeof(value) == "object") value = JSON.stringify(value);
send("\"" + value.replace(/\"/g, '""') + "\"");
} else {
if (startedOutput) send(",");
}