-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Invalid HTML due to readEnding failure. #1107
Comments
This looks to be due to caching that is used for filesize(). I can fix this on our side by forcing a reset before trying to loadIntoExisting(), but maybe PhpSpreadhseet should be doing that as well. |
Would you be able to suggest a PR covered with tests ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Still an issue - reopening. |
Fix PHPOffice#1107. Clear statcache for file before requesting its size.
This is:
What is the expected behavior?
The HTML is valid and is able to find the end which is nothing more than a > symbol
What is the current behavior?
Due to size of the file returned from filesize() the fseek is returning no data which causes it to fail. This appears to be due to using the same filename for loadingIntoExisting. The filesize reported is for the original version, but when it is updated with new data filesize does not report the new size.
What are the steps to reproduce?
Try to use loadIntoExisting() on a smaller HTML file (in this case the OS is reporting 1,518 bytes, 4k on disk). Filesize returns 19792 as the size and then tries to seek to the offset based off of the sample size (19792 - 2048) which goes past the end of the file.
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
Which versions of PhpSpreadsheet and PHP are affected?
Php 7.1.29 / PhpSpreadsheet 1.8
The text was updated successfully, but these errors were encountered: