Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.6
-
None
Description
org.apache.commons.text.translate.CsvTranslators:
void translateWhole(CharSequence input, Writer out) throws IOException { if (input.charAt(0) == '"' && input.charAt(input.length() - 1) == '"') { String quoteless = input.subSequence(1, input.length() - 1).toString(); if (StringUtils.containsAny(quoteless, CsvTranslators.CSV_SEARCH_CHARS)) { out.write(StringUtils.replace(quoteless, CsvTranslators.CSV_ESCAPED_QUOTE_STR, CsvTranslators.CSV_QUOTE_STR)); } else { out.write(input.toString()); } } else { out.write(input.toString()); } }
In my opinion first occurence "out.write(input.toString());" should be replaced with:
out.write(quoteless.toString());
Because '"' quotes around "input" will be never removed.
Attachments
Issue Links
- links to