Skip to content

Commit

Permalink
Also if it has newline
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Nov 5, 2024
1 parent 1df44e3 commit 6492cc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/http/chan_form.pike
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ __async__ void wscmd_download_csv(object channel, mapping(string:mixed) conn, ma
foreach (rows, array row) {
foreach (row; int i; string cell) {
if (i) csv->add(",");
if (has_value(cell, '"')) csv->add("\"" + replace(cell, (["\\": "\\\\", "\"": "\\\""])) + "\"");
else csv->add(replace(cell, (["\\": "\\\\", "\"": "\\\""])));
if (has_value(cell, '"') || has_value(cell, '\n')) csv->add("\"" + replace(cell, (["\\": "\\\\", "\"": "\\\""])) + "\"");
else csv->add(cell);
}
csv->add("\n");
}
Expand Down

0 comments on commit 6492cc3

Please sign in to comment.