diff --git a/src/Uri.php b/src/Uri.php index f5edf41..9828a4c 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -35,7 +35,7 @@ class Uri protected const PATH_REGEX = '`^(?:(?:%[a-f0-9]{2})+|[a-z0-9-._~!$&\'()*+,;=:@/]+)*$`i'; - protected const QUERY_OR_FRAGMENT_REGEX = '`^(?:(?:%[a-f0-9]{2})+|[a-z0-9-._~!$&\'"()\[\]*+,;=:@?/%]+)*$`i'; + protected const QUERY_OR_FRAGMENT_REGEX = '`^(?:(?:%[a-f0-9]{2})+|[a-z0-9-._~!$&\'"()\[\]*+,;=:@?/%{}]+)*$`i'; protected array $components; diff --git a/tests/UriMergeTest.php b/tests/UriMergeTest.php index 7f331a0..036a80e 100644 --- a/tests/UriMergeTest.php +++ b/tests/UriMergeTest.php @@ -45,6 +45,7 @@ public function uriProvider() ["//g", "http://g"], ["?y", "http://a/b/c/d;p?y"], ["g?y", "http://a/b/c/g?y"], + ["g?y={y}", "http://a/b/c/g?y={y}"], ["#s", "http://a/b/c/d;p?q#s"], ["g#s", "http://a/b/c/g#s"], ["g?y#s", "http://a/b/c/g?y#s"],