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

ZipArchive and "Inconsistent" Zip File #2376

Merged
merged 4 commits into from
Nov 12, 2021
Merged

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Nov 6, 2021

Fix #2362. I added test for zip file inconsistency when dealing with a particularly nasty PHP/libzip bug affecting zero-length files. However, we also now verify that the file starts with a valid zip signature, so the consistency test is not really needed, and, from what I've read on the web, isn't particularly useful. The file with a problem, for example, opens just fine with Excel and zip, despite Php reporting it as inconsistent (when asked to check consistency). So, remove the consistency check.

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

Fix PHPOffice#2362. I added test for zip file inconsistency when dealing with a particularly nasty PHP/libzip bug affecting zero-length files. However, we also now verify that the file starts with a valid zip signature, so the consistency test is not really needed, and, from what I've read on the web, isn't particularly useful. The file with a problem, for example, opens just fine with Excel and zip, despite Php reporting it as inconsistent (when asked to check consistency). So, remove the consistency check.
Latest Phpstan does not allow cast from 'mixed' to 'string'.
@oleibman oleibman merged commit f831f48 into PHPOffice:master Nov 12, 2021
@oleibman oleibman deleted the issue2362 branch November 26, 2021 18:08
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.

Error with reading file
1 participant