[php-src] Issue #19918: Uri\WhatWg\Url host validation when using withHost and invalid IPv6 host
| From: | nyamsprod | Date: | Mon, 22 Sep 2025 12:36:39 +0000 |
| Subject: | [php-src] Issue #19918: Uri\WhatWg\Url host validation when using withHost and invalid IPv6 host | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250880@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19918
Author: nyamsprod
### Description
The following code:
```php
<?php
echo (new
Uri\WhatWg\Url('scheme://host'))->withHost('[::1')->toAsciiString();
```
Resulted in this output:
```
scheme://host
```
But I expected this output instead:
```
InvalidUrlException to be thrown
```
The error is silently ignore instead of throwing an exception with
UrlValidationErrorType::Ipv6Unclosed
see https://3v4l.org/c6jcZ/rfc#vgit.master
### PHP Version
```plain
PHP 8.5-dev
```
### Operating System
_No response_