From 25db47753191956ab656fca811d466cf552d2dd0 Mon Sep 17 00:00:00 2001 From: Max Ogden Date: Wed, 15 Jun 2011 20:31:29 -0700 Subject: [PATCH] always properly escape double quotes --- lists/csv.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lists/csv.js b/lists/csv.js index 5b5cde83..e3d99df5 100644 --- a/lists/csv.js +++ b/lists/csv.js @@ -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(","); }