[#419] Escape quotes properly in csv export

This commit is contained in:
Marius David Wieschollek 2018-04-07 20:27:58 +02:00
parent 784e71712f
commit 47787df503
No known key found for this signature in database
GPG key ID: 5EC95BDC15EED86B

View file

@ -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 = {