stream_is_local(): unwrap zlib and bzip2 wrappers if needed - #23714
Open
DanielEScherzer wants to merge 3 commits into
Open
DanielEScherzer wants to merge 3 commits into
DanielEScherzer wants to merge 3 commits into
Conversation
Add tests to demonstrate that the `zlib:`, `compress.zlib://`, and `compress.bzip2://` wrappers also result in `stream_is_local()` returning `true`. This behavior will be changed in a subsequent commit.
When a stream is wrapped with `zlib:`, `compress.zlib://`, or `compress.bzip2://` (and the relevant extension is installed to apply that wrapper), remove that prefix before trying to determine if a stream is local or not.
ndossche
reviewed
Sep 19, 2026
| context = php_stream_context_from_zval(zcontext, 0); | ||
| wrapper = php_stream_locate_url_wrapper(Z_STRVAL_P(zstream), NULL, 0); | ||
|
|
||
| // Skip past any of `zlib:`, `compress.zlib://`, and `compress.bzip2://` |
Member
There was a problem hiding this comment.
This is a hack, not a real fix. Now details of zlib and bzip2 leak into the standard extension.
bukka
requested changes
Sep 19, 2026
bukka
left a comment
Member
There was a problem hiding this comment.
As Nora said, this is a hack. It needs to get info from the wrapper and not doing checks by name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a stream is wrapped with
zlib:,compress.zlib://, orcompress.bzip2://(and the relevant extension is installed to apply that wrapper), remove that prefix before trying to determine if a stream is local or not.