File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class CsvFileLoader extends FileLoader
2222{
2323 private $ delimiter = '; ' ;
2424 private $ enclosure = '" ' ;
25- private $ escape = '\\ ' ;
25+ private $ escape = '' ;
2626
2727 /**
2828 * {@inheritdoc}
@@ -38,7 +38,7 @@ protected function loadResource(string $resource)
3838 }
3939
4040 $ file ->setFlags (\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY );
41- $ file ->setCsvControl ($ this ->delimiter , $ this ->enclosure , $ this ->escape );
41+ $ file ->setCsvControl ($ this ->delimiter , $ this ->enclosure , '' === $ this -> escape && \ PHP_VERSION_ID < 70400 ? '\\' : $ this ->escape );
4242
4343 foreach ($ file as $ data ) {
4444 if (false === $ data ) {
@@ -56,10 +56,10 @@ protected function loadResource(string $resource)
5656 /**
5757 * Sets the delimiter, enclosure, and escape character for CSV.
5858 */
59- public function setCsvControl (string $ delimiter = '; ' , string $ enclosure = '" ' , string $ escape = '\\ ' )
59+ public function setCsvControl (string $ delimiter = '; ' , string $ enclosure = '" ' , string $ escape = '' )
6060 {
6161 $ this ->delimiter = $ delimiter ;
6262 $ this ->enclosure = $ enclosure ;
63- $ this ->escape = $ escape ;
63+ $ this ->escape = '' === $ escape && \ PHP_VERSION_ID < 70400 ? '\\' : $ escape ;
6464 }
6565}
You can’t perform that action at this time.
0 commit comments