Skip to content

return FALSE instead of NULL from ZipArchive::getStream when php_stream_... #1257

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

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented May 1, 2015

...zip_open() fails (fixes #67161)

@smalyshev smalyshev added the Bug label May 8, 2015
@jpauli
Copy link
Member

jpauli commented May 12, 2015

Why return false instead of null ? Do we have a consensus about this (I can barely remind something) ?

@cmb69
Copy link
Member Author

cmb69 commented May 12, 2015

The documentation of ZipArchive::getStream states that a file handle or false is returned. Returning null usually occurs when a wrong parameter type is given, but that is not the case here.

Alternatively, bug #67161 might be changed to doc bug, but it seems to me returning false instead of null is clearer for the user.

Of course, returning false instead of null would be a BC break, but probably a very minor one. Note that a failing zip_stat() will already return false, so only if the file exists, but can't be decoded the return value would change.

@jpauli
Copy link
Member

jpauli commented May 12, 2015

Merged against master as this would break stable branches

@jpauli jpauli closed this May 12, 2015
@cmb69 cmb69 deleted the getstream-failure-fix branch July 12, 2015 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants