[php-src] Issue #21427: \Uri\Rfc3986\Uri does not handle some non-encoded characters (`@`, `[`)

From: Date: Fri, 13 Mar 2026 01:10:06 +0000
Subject: [php-src] Issue #21427: \Uri\Rfc3986\Uri does not handle some non-encoded characters (`@`, `[`)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-251799@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/21427 Author: earthiverse ### Description The following code: ```sh var_dump(new \Uri\Rfc3986\Uri("http://media-store.localhost/img/store/31/bc/0ef8ebbc4035984ef59aa595cf4f7ee8d068/%C3%89t%C3%89@%C3%89b%C3%89g%C3%89o%C3%85[%C3%89K%C3%85[%C3%87Q.jpg")); ``` Resulted in this output: ``` PHP Warning: Uncaught Uri\InvalidUriException: The specified URI is malformed ``` But I expected this output instead: ``` class Uri\Rfc3986\Uri#2 (8) { public $scheme => string(4) "http" public $username => NULL public $password => NULL public $host => string(21) "media-store.localhost" public $port => NULL public $path => string(118) "/img/store/31/bc/0ef8ebbc4035984ef59aa595cf4f7ee8d068/%C3%89t%C3%89@%C3%89b%C3%89g%C3%89o%C3%85[%C3%89K%C3%85[%C3%87Q.jpg" public $query => NULL public $fragment => NULL } ``` --- I'm not too sure about RFC 3986, but I copied that URL straight from my browser's URL, and it didn't encode the @ or [ characters when I copied it. If I percent-encode those, it parses OK. https://en.wikipedia.org/wiki/Percent-encoding#Reserved_characters says "reserved characters that have no reserved purpose in a particular context may also be percent-encoded but are not semantically different from those that are not." ### PHP Version ```plain PHP 8.5.3 (cli) (built: Feb 10 2026 18:25:51) (NTS) Copyright (c) The PHP Group Built by Shivam Mathur Zend Engine v4.5.3, Copyright (c) Zend Technologies with Xdebug v3.5.1, Copyright (c) 2002-2026, by Derick Rethans with Zend OPcache v8.5.3, Copyright (c), by Zend Technologies ``` ### Operating System MacOS Tahoe 26.3.1

« previous php.bugs (#251799) next »