Repository navigation
Conversation
added 2 commits
October 1, 2026 18:01
CsvHelper::getCsv() called setCsvControl() without arguments, so it could read only comma-separated files and PHP 8.4+ reported the implicit $escape default on every call. A file exported with a UTF-8 BOM left its first column unmapped in AbstractCsvRowAccessor, and a caller had no way to tell a missing column or a blank line from an invalid row. - getCsv() takes separator, enclosure and escape with the current defaults and passes them explicitly - setHeader() strips a UTF-8 BOM from the first header cell - getMissingHeaders() lists the HEADERS the file lacks, isEmpty() detects a blank line read as [null] - CHANGELOG entry for 11.7.0
A BOM in front of an enclosure keeps fgetcsv() from recognising a quoted first header, so a file exported with a BOM and quoted headers (PowerShell Export-Csv, LibreOffice "Quote all text cells") still left its first column unmapped: the parsed cell kept its quotes once the BOM was cut off. - readHeaders() rewinds, reads three bytes and rewinds again unless they are the BOM, then parses - the getCsv() test passes a custom enclosure, so dropping it from setCsvControl() fails the test
TomasHermanek
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CsvHelper::getCsv() called setCsvControl() without arguments, so it could read only comma-separated files and PHP 8.4+ reported the implicit $escape default on every call. A file exported with a UTF-8 BOM left its first column unmapped in AbstractCsvRowAccessor, and a caller had no way to tell a missing column or a blank line from an invalid row.