mirror of
https://github.com/tomfong/simple-qr.git
synced 2025-06-28 12:09:58 +00:00
fix: make csv content safer
This commit is contained in:
parent
4112190dbc
commit
0e1661fe4b
1 changed files with 2 additions and 2 deletions
|
@ -326,10 +326,10 @@ export class SettingRecordPage {
|
|||
rawCsvData = "ID,Content,Created at,Source,Barcode Type,Bookmarked?,Tag\r\n";
|
||||
}
|
||||
this.env.scanRecords.forEach(r => {
|
||||
rawCsvData += `${r.id},"${r.text}","${this.maskDatetime(r.createdAt)}",${this.maskSource(r.source)},${r.barcodeType ?? ''},`
|
||||
rawCsvData += `${r.id},"${r.text?.split('"').join('') ?? ""}","${this.maskDatetime(r.createdAt)}",${this.maskSource(r.source)},${r.barcodeType ?? ''},`
|
||||
const bookmark = this.env.bookmarks.find(b => b.text == r.text);
|
||||
if (bookmark != null) {
|
||||
rawCsvData += `TRUE,"${bookmark.tag}"\r\n`;
|
||||
rawCsvData += `TRUE,"${bookmark.tag?.split('"').join('') ?? ""}"\r\n`;
|
||||
} else {
|
||||
rawCsvData += "FALSE, \r\n";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue