Skip to content

Commit a74e8e8

Browse files
(#3208) Replace double quotes with singles
1 parent a7204f2 commit a74e8e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

WebApp/src/uk/ac/exeter/QuinCe/data/Export/ExportOption.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,12 @@ public ExportData makeExportData(DataSource dataSource, Instrument instrument,
414414
*
415415
* <p>
416416
* Newlines are replaced with semicolons. Instances of the separator are
417-
* replaced with spaces.
417+
* replaced with spaces. Double quotes are escaped.
418418
* </p>
419419
*
420420
* @param fieldValue
421-
* @return
421+
* The value to be formatted.
422+
* @return The formatted value.
422423
*/
423424
public String format(String fieldValue) {
424425
String result = null;
@@ -430,7 +431,8 @@ public String format(String fieldValue) {
430431
} else {
431432
String newlinesRemoved = fieldValue.replaceAll("[\\r\\n]", " ");
432433
String separatorsRemoved = newlinesRemoved.replaceAll(separator, " ");
433-
return separatorsRemoved;
434+
String quotesEscaped = separatorsRemoved.replaceAll("\"", "'");
435+
return quotesEscaped;
434436
}
435437

436438
return result;

0 commit comments

Comments
 (0)