diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 6ce3a6b12..0afe90c10 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -187,11 +187,10 @@ final class UriFactory */ private static function unique(string $url) : string { - $parts = \explode('?', $url); + $parts = \explode('&', \str_replace('?', '&', $url)); if (count($parts) >= 2) { - $full = $parts[1]; - $pars = \explode('&', $full); + $pars = \array_slice($parts, 1); $comps = []; $length = count($pars); diff --git a/tests/Uri/UriFactoryTest.php b/tests/Uri/UriFactoryTest.php index fcf98da43..b45a44514 100644 --- a/tests/Uri/UriFactoryTest.php +++ b/tests/Uri/UriFactoryTest.php @@ -66,7 +66,7 @@ class UriFactoryTest extends \PHPUnit\Framework\TestCase public function testBuilder() { - $uri = 'www.test-uri.com?id={@ID}&test={.mTest}&two={/path}&hash={#hash}&none=#none&found={/not}&v={/valid2}'; + $uri = 'www.test-uri.com?id={@ID}&test={.mTest}&two={/path}&hash={#hash}&none=#none&found={/not}?v={/valid2}'; $vars = [ '@ID' => 1,