Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1dd8bba

Browse files
committed
Feat: Add missing DROP_NEW_LINE flag to support empty lines in CSV
1 parent cf8e398 commit 1dd8bba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Symfony/Component/Translation/Loader/CsvFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function loadResource(string $resource): array
3333
throw new NotFoundResourceException(\sprintf('Error opening file "%s".', $resource), 0, $e);
3434
}
3535

36-
$file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY);
36+
$file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY | \SplFileObject::DROP_NEW_LINE);
3737
$file->setCsvControl($this->delimiter, $this->enclosure, '');
3838

3939
foreach ($file as $data) {

0 commit comments

Comments
 (0)