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 function getFromIndex() returns exception on archive with empty file #450

Open
OskarsOzols opened this issue Aug 23, 2024 · 0 comments

Comments

@OskarsOzols
Copy link

If the zip archive contains an empty file, the getFromIndex() function in the safe library throws an exception.

Exception message states "Failed to extract file from the zip archive: No error".

Native ZipArchive has this error code
[ZipArchive::ER_OK](https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.er-ok) ([int](https://www.php.net/manual/en/language.types.integer.php)) No error.

This behavior is a flawed design in PHP, where an "error" message is generated despite there being no actual error. This could potentially be addressed and handled in the safe library to prevent the exception from being thrown in such cases.

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

No branches or pull requests

1 participant