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

Fix XLSX reader when having a corrupt numeric cell data type #1664

Merged
merged 5 commits into from Feb 1, 2021
Merged

Fix XLSX reader when having a corrupt numeric cell data type #1664

merged 5 commits into from Feb 1, 2021

Conversation

brainfoolong
Copy link
Contributor

This is:

- [x] a bugfix

Checklist:

Why this change is needed?

In some rare cases, when reading an XLSX file that may contain invalid cell type values, the reader throw an error. It happens when the found data type in a table cell is numeric, but the actual value is an empty string. This will throw a exception and the result is the file cannot be read.

You can open those files in any reader (LibreOffice, MS Office) without problems but PhpSpreadsheet struggles with it.

Unfortunetely i cannot add tests or a demonstration file because our files that cause this error contains sensible data. If we try to remove the sensible data, the file is automatically fixed by our Office Suite. The file we use is generated from a third party company, so we have no chance to generate files with those errors.

Hopefully this PR will be merged even if no test scenario is provided.

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@stale stale bot added the stale label Dec 25, 2020
@brainfoolong
Copy link
Contributor Author

Ping, before it get closed for inactivity. Some maintainer here?

@stale stale bot removed the stale label Dec 25, 2020
@MarkBaker
Copy link
Member

Thanks for highlighting this. It always surprises me how much of the Reader code is devoted to handling malformed content or corrupted/invalid files.

I've not been able to recreate a test workbook to demonstrate the problem either; but I can't see the patch causing any problems.

@MarkBaker MarkBaker merged commit fa51a85 into PHPOffice:master Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants