Skip to content

ext/uri: Consistency follow up to #23286 - #23551

Merged
kocsismate merged 14 commits into
php:masterfrom
NickSdot:hardening/ext-uri-reorg-follow-up
Sep 4, 2026
Merged

ext/uri: Consistency follow up to #23286#23551
kocsismate merged 14 commits into
php:masterfrom
NickSdot:hardening/ext-uri-reorg-follow-up

Conversation

@NickSdot

@NickSdot NickSdot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Depends on: #23286; as requested in #23286 (comment).

cc @kocsismate

--FILE--
<?php

$url = Uri\WhatWg\Url::parse("foo://example.com");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was exact duplicate of host_error_forbidden_host_codepoint_special2.phpt (now host_error_colon_special.phpt); I assume the intention was to test the same as in the special tests, so I did that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Diff does not recognise it as rename; this is whatwg/modification/host_error_forbidden_host_codepoint_special3.phpt which is shown as deleted below. The code change is:

-$url = Uri\WhatWg\Url::parse("https://example.com");
+$url = Uri\WhatWg\Url::parse("foo://example.com");

@@ -1,5 +1,5 @@
--TEST--
Test Uri\WhatWg\Url component modification - error - modifying multiple components with warnings before throwing an exception
Test Uri\WhatWg\Url component modification - error - earlier warnings not in exception

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here no method added. Although withScheme() is used this is testing that warnings aren't carried over -- so I did not see that as method specific?

@@ -1,5 +1,5 @@
--TEST--
Test Uri\Rfc3986\Uri component modification - port - too small number
Test Uri\Rfc3986\Uri::withPort() - error - negative number

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Elsewhere either "negative value" or "negative number" was used. Here we have (int) -1 so negative number should be correct?

@NickSdot
NickSdot force-pushed the hardening/ext-uri-reorg-follow-up branch from 6a5e074 to 1208372 Compare September 4, 2026 09:48
@NickSdot
NickSdot marked this pull request as ready for review September 4, 2026 09:54
@NickSdot
NickSdot marked this pull request as draft September 4, 2026 11:47

@kocsismate kocsismate 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.

looks good to me, thanks, with the only one nit below:

Comment thread ext/uri/tests/whatwg/general/memory_management.phpt Outdated
@NickSdot

NickSdot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

@kocsismate I just noticed that reference_resolutions aren't sound yet, hence marked back as draft. Should we:

-Test Uri\Rfc3986\Uri reference resolution - parse() - absolute URI with base URI
+Test Uri\Rfc3986\Uri::parse() - success - absolute URI with base URI
-Test Uri\WhatWg\Url reference resolution - resolve() - IPv4 with too many parts
+Test Uri\WhatWg\Url::resolve() - error - IPv4 with too many parts

Also noted on the nit above.

@kocsismate

Copy link
Copy Markdown
Member

I just noticed that reference_resolutions aren't sound yet, hence marked back as draft. Should we:

Yes, I agree with the suggestion.

@NickSdot

NickSdot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

I just noticed that reference_resolutions aren't sound yet, hence marked back as draft. Should we:

Yes, I agree with the suggestion.

Done in 3d340ec and 08b9d05. 🫡

@NickSdot
NickSdot marked this pull request as ready for review September 4, 2026 12:04
@NickSdot

NickSdot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Failure unrelated.

@kocsismate
kocsismate merged commit fd81673 into php:master Sep 4, 2026
16 of 18 checks passed
@NickSdot
NickSdot deleted the hardening/ext-uri-reorg-follow-up branch September 4, 2026 14:41
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