Implement "Followup improvements for ext/uri" RFC - WHATWG URL building#22268
Open
kocsismate wants to merge 1 commit into
Open
Implement "Followup improvements for ext/uri" RFC - WHATWG URL building#22268kocsismate wants to merge 1 commit into
kocsismate wants to merge 1 commit into
Conversation
97cb0bf to
0655d8c
Compare
kocsismate
commented
Jun 25, 2026
| goto failure; | ||
| } | ||
|
|
||
| if (lexbor_base_url != NULL) { |
Member
Author
There was a problem hiding this comment.
What's a big shame is that apparently it's not possible to properly use the builder with a base URL :(
- if we try to add the base URL after the input URL is built, then legitimate relative URLs are rejected (e.g.
/foo+https://example.com), because/foois not a valid URL on its own - If we try to build the input URL with the base URL in the same time, then the parsing algorithm must be used (currently, only setters are used with a hack on line 821). Then the complication is to find some URL component that is suitable for parsing:
- for special, full URLs: scheme + host is needed at least (e.g. https://example.com)
- for non-special full URLs: scheme is needed at least (e.g. https://)
- for relative URLs: the path is needed at least (e.g.
/foo/bar)
And in the 2nd case, the question arises if it's ok to parse only the minimally required components and then set the rest of the components, or the whole input URL must be built and parsed all at once.
0655d8c to
af73d4a
Compare
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.
RFC: https://wiki.php.net/rfc/uri_followup#uri_building