Bug #68127
closedCsvUtility method csvToArray does not handle enclosures right
100%
Description
When we have a csv string with enclosures, the first str_getcsv(), which is responsible for exploding the rows, strips off the enclosure of the first row. This is a bug in str_getcsv().
Imagine the next string
"Column A And a newline", "Column B", "Column C" "Value", "Value2", "Value 3"
after exploding the rows with str_getcsv(), the output will be
Column A And a newline, "Column B", "Column C" Value, "Value2", "Value 3"
The enclosure of the first columns (double quotes) is deleted.
When you have a comma in that cell, the cell will be splitted in two when passing the row string through str_getcsv()
The best solution seems to be to write the string to a temporary file and use fgetcsv().
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41211
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41211
Updated by Gerrit Code Review over 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41211
Updated by Patrick Broens over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 974344ac349bb2bd8ddb7cb6f462780bf6260908.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed