[BUGFIX] CsvUtility method csvToArray does not handle enclosures right 11/41211/4
authorPatrick Broens <patrick@patrickbroens.nl>
Tue, 14 Jul 2015 14:24:07 +0000 (16:24 +0200)
committerPatrick Broens <patrick@patrickbroens.nl>
Tue, 14 Jul 2015 20:17:19 +0000 (22:17 +0200)
commit974344ac349bb2bd8ddb7cb6f462780bf6260908
treec01fa96a976def2700206ef46ba37ab91bd61efd
parent5fd2449951ff0ac6202df06c33e1d73582591aa9
[BUGFIX] CsvUtility method csvToArray does not handle enclosures right

When we have a csv string with enclosures, the string is sometimes not
correctly transformed into a multidimensional array. The cause of this
is the first str_getcsv() function, responsible for exploding the rows.
It returns rows where the first column does not have an enclosure
anymore.

This patch fixes this by using fgetcsv(). A temporary file is created
and written to the typo3temp folder and then passed to fgetcsv(). This
way we get a correct multidimensional array from the csv string.

Change-Id: I042c1ab326ef2b5f5cdd2b1455da76ccefd5ae36
Resolves: #68127
Releases: master
Reviewed-on: http://review.typo3.org/41211
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Patrick Broens <patrick@patrickbroens.nl>
Tested-by: Patrick Broens <patrick@patrickbroens.nl>
typo3/sysext/core/Classes/Utility/CsvUtility.php
typo3/sysext/core/Tests/Unit/Utility/CsvUtilityTest.php
typo3/sysext/frontend/Classes/DataProcessing/CommaSeparatedValueProcessor.php