Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect reader used for CSV files with BOM #4028

Closed
2 tasks done
SchmidtClaudia opened this issue May 15, 2024 · 1 comment
Closed
2 tasks done

Incorrect reader used for CSV files with BOM #4028

SchmidtClaudia opened this issue May 15, 2024 · 1 comment

Comments

@SchmidtClaudia
Copy link
Contributor

SchmidtClaudia commented May 15, 2024

This is:

  • a bug report

What is the expected behavior?

Reading an CSV file with IOFactory::load($file) should use the Csv Reader no matter whether the file starts with a BOM or not. The HTML Reader should do further checks regarding tags after finding a BOM.

What is the current behavior?

The HTML reader checks if the file starts with a BOM and returns true without any further syntax checks.

I think the bug was introduced with this change 09c9a31#diff-914de62bf54eee4a88135dcbbbce0cf9a59ad5c08b21ac454e645d2bad2390caR151

What are the steps to reproduce?

  1. Create a CSV file starting with a BOM.
  2. Try to load the file with IOFactory::load($file)

see my test in #4029

What features do you think are causing the issue

  • Reader

Does an issue affect all spreadsheet file formats? If not, which formats are affected?

CSV, HTML

Which versions of PhpSpreadsheet and PHP are affected?

5.1.0

@SchmidtClaudia SchmidtClaudia changed the title [WIP] Incorrect reader used for CSV files with BOM Incorrect reader used for CSV files with BOM May 15, 2024
github-merge-queue bot pushed a commit that referenced this issue May 16, 2024
Incorrect reader used for CSV files with BOM #4028
@oleibman
Copy link
Collaborator

Fixed by PR #4029.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants