Skip to content

Fix GH-25604: Report accepted IPv4 range errors as non-fatal - #25614

Open
akouhr00t wants to merge 2 commits into
php:PHP-8.5from
akouhr00t:fix-gh-25604
Open

akouhr00t wants to merge 2 commits into
php:PHP-8.5from
akouhr00t:fix-gh-25604

Conversation

@akouhr00t

@akouhr00t akouhr00t commented Nov 19, 2026 •

Copy link
Copy Markdown

Fixes #25604. Thanks to @M4kuq for reporting and diagnosing the issue.

PHP accepts http://2130706433/ and normalizes its host to 127.0.0.1,
but marks the IPv4 range warning as fatal. This change preserves the
warning and sets failure to false when the final IPv4 part fits in
the remaining octets. Genuine overflows still fail.

The regression test also covers a valid integer host followed by an
invalid port, so each diagnostic retains the correct severity.

Tested on PHP 8.5.13. The regression test failed before the fix and
passed afterward. The URI suite had 330 passes, 6 skips, and 0 failures.

Keep the range warning for a final IPv4 part that spans multiple octets. Classify it while parsing the host so a later port failure does not change its severity. Reported by M4kuq.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functional changes to Lexbor need to first be accepted upstream at https://github.com/lexbor/lexbor/pulls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants