Project

General

Profile

Actions

Bug #68127

closed

CsvUtility method csvToArray does not handle enclosures right

Added by Patrick Broens over 9 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Category:
Fluid Styled Content
Target version:
Start date:
2015-07-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

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().

Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

Updated by Patrick Broens over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF