From 47787df5032c8cf7a6d16fe5706bb9449005701e Mon Sep 17 00:00:00 2001 From: Marius David Wieschollek Date: Sat, 7 Apr 2018 20:27:58 +0200 Subject: [PATCH] [#419] Escape quotes properly in csv export --- js/exporters/exporter-csv.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/exporters/exporter-csv.js b/js/exporters/exporter-csv.js index 70ec4740..c1c883e2 100644 --- a/js/exporters/exporter-csv.js +++ b/js/exporters/exporter-csv.js @@ -47,7 +47,7 @@ PassmanExporter.csv.export = function (credentials, FileService, EncryptService) _tags.push(_credential[field][t].text); } var tag_data = '[' + _tags.join(",") + ']'; - row_data.push('"' + tag_data + '"'); + row_data.push('"' + tag_data.replaceAll('"', '""') + '"'); } else if (field == 'custom_fields' || field == 'files') { var _fields = JSON.stringify(_credential[field]); @@ -55,7 +55,7 @@ PassmanExporter.csv.export = function (credentials, FileService, EncryptService) row_data.push('"' + _fields + '"'); } else { - row_data.push('"' + _credential[field] + '"'); + row_data.push('"' + _credential[field].replaceAll('"', '""') + '"'); } } var progress = {