Skip to content

Fix parse_url() IPv6 bracketed host and port parsing (#13739) - #13745

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-13739-parse-url-ipv6-host
Jun 29, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-13739-parse-url-ipv6-host

Conversation

@PurHur

@PurHur PurHur commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Parse IPv6 literal authorities in bracket notation ([::1], [2001:db8::1]) as opaque host tokens.
  • Extract :port only after the closing ], matching php-src ext/standard/url.c (php_url_parse_ex2).

Implementation: ext/standard/VmString.php::parseUrlAuthority() (JIT/AOT reuse VmString::parseUrl via JitParseUrl).

Verification

php test/repro/maintainer_gap_parse_url_ipv6_host.php
php bin/vm.php test/repro/maintainer_gap_parse_url_ipv6_host.php
# four ok:… lines

./script/docker-exec.sh -- bash -lc './vendor/bin/phpunit --filter parse_url_ipv6_host'
# OK (4 tests)

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -l test/repro/maintainer_gap_parse_url_ipv6_host.php'
# AOT lint OK

Closes #13739

Made with Cursor

Treat bracketed IPv6 literals as opaque host tokens and parse :port only
after the closing bracket, matching php-src ext/standard/url.c.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 7867662 into master Jun 29, 2026
@PurHur
PurHur deleted the agent/issue-13739-parse-url-ipv6-host branch June 29, 2026 18:39
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

Successfully merging this pull request may close these issues.

Regression: parse_url() IPv6 bracketed host — host truncated at first colon, port dropped (ext/standard/url.c)

1 participant