Skip to content

uri: Fix Uri\WhatWg\Url screens that ignore URL normalization - #5721

Merged
jordikroon merged 1 commit into
php:masterfrom
KentarouTakeda:fix-screens-that-never-matched
Aug 7, 2026
Merged

uri: Fix Uri\WhatWg\Url screens that ignore URL normalization#5721
jordikroon merged 1 commit into
php:masterfrom
KentarouTakeda:fix-screens-that-never-matched

Conversation

@KentarouTakeda

@KentarouTakeda KentarouTakeda commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Third batch from the audit behind #5718: screens that do not match what their example prints.

Uri\WhatWg\Url::getPort() and withPort() echoed a port that WHATWG normalization removes, so both printed nothing while the screens claimed 443. They use var_dump() now, and show a port that survives normalization and one that does not. Url::parse() gains the / that normalization adds to an empty path.

Three more screens were here and have been dropped. Two had wrong values that nothing in the examples depends on, and the third is now #5740.

Press Run code on these pages and the output that appears is what this PR puts in the <screen>:

@KentarouTakeda
KentarouTakeda requested a review from TimWolla as a code owner July 28, 2026 12:43
@KentarouTakeda
KentarouTakeda force-pushed the fix-screens-that-never-matched branch from ff40a1a to f578447 Compare July 31, 2026 18:16
A WHATWG URL does not store the port when it is the scheme's default, so
getPort() and withPort() both echoed null while their screens claimed
443, and Url::parse() normalizes an empty path to "/", which its screen
did not show. The extension is new in PHP 8.5, so these were wrong from
the start.

Echoing null renders as an empty box, so the two port examples use
var_dump() now and also show a port that is kept: the contrast is what
makes the normalization legible.
@KentarouTakeda
KentarouTakeda force-pushed the fix-screens-that-never-matched branch 2 times, most recently from a3a2b37 to 6f423ad Compare August 4, 2026 13:28
@KentarouTakeda KentarouTakeda changed the title Fix screens that never matched their example uri: Fix Uri\WhatWg\Url screens that ignore URL normalization Aug 4, 2026

@TimWolla TimWolla left a comment

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.

Thank you!

@jordikroon
jordikroon merged commit 0e06411 into php:master Aug 7, 2026
2 checks passed
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.

3 participants