benkeen / generatedata

A powerful, feature-rich, random test data generator.
https://generatedata.com
2.21k stars 610 forks source link

List Data Type + CSV Export Type: single double quotes in list items aren't escaped properly #728

Open benkeen opened 2 years ago

benkeen commented 2 years ago

To reproduce:

Result: the content of the column is incorrectly escaped.

e.g. if the item was "value", the output would be:

one,"value"

This superficially looks fine but it's actually not: the double quotes will be lost. A clearer example of the bug would be if you entered a "Exactly 2" option in the UI, which would generate something like this:

one,"two,"value""

As you can see, the internal double quotes around "value" aren't escaped. For each case I think the generated output should be this:

one,"""value"""
one,"two,""value"""