Repository navigation
Conversation
`glob(3)` doesn't know the virtual CWD of PHP, so we need to pass an absolute path for ZTS builds. In lack of a reusable routine, we copy the code from `glob()` and adapt as needed.
We should strip the CWD whenever we call `php_glob_stream_path_split()`, but that would require to store the value in `glob_s_t` what we cannot do for stable PHP versions since it would be an ABI break. Thus we traverse `gl_pathv`, and strip the prepended CWD there.
bukka
reviewed
Dec 8, 2024
bukka
left a comment
Member
There was a problem hiding this comment.
I think it should work. It wouldn't work for glob with braces (I actually started testing it with it to check if this still works) but glob wrapper does not pass that flag so braces cannot be used so using IS_ABSOLUTE_PATH should be reliable for identifying absolute path here.
cmb69
marked this pull request as ready for review
December 8, 2024 17:59
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.
glob(3)doesn't know the virtual CWD of PHP, so we need to pass an absolute path for ZTS builds. In lack of a reusable routine, we copy the code fromglob()and adapt as needed.In my opinion, there should be some routine (likely in zend_virtual_cwd) which makes a path absolute, but without normalization or even getting the real path (just quickly prepending the VCWD if necessary). I'm not quite convinced that we should introduce that routine for stable branches, though.