Bug 37606: Fix framework export module to escape double quotes

When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken.

TEST PLAN:
1 - Change a framework to add a field containing double quote in name
2 - Export it in csv
3 - Create a new framework
4 - Import the csv in the new framework -> every fields after the one
containing double quotes should be broke. Every other fields should have
no subfield
5 - APPLY PATCH
6 - Repeat 2-5 -> everything should be correctly exported

Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Baptiste Wojtkowski 2024-08-09 16:33:37 +02:00 committed by Katrin Fischer
parent 6760de2d88
commit 5f45818cf7
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 0 deletions

View File

@ -291,6 +291,7 @@ sub _export_table_csv
for my $field (@fields) {
my $value = $hashRef->{$field} // q||;
$value =~ s/[\r\n]//g;
$value =~ s/"/""/g;
$$strCSV .= '"' . $value . '",';
}
chop $$strCSV;