We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e708635 commit 53b90d0Copy full SHA for 53b90d0
uri/Uri.php
@@ -17,6 +17,7 @@
17
use Deprecated;
18
use finfo;
19
use League\Uri\Contracts\Conditionable;
20
+use League\Uri\Contracts\FragmentDirective;
21
use League\Uri\Contracts\UriComponentInterface;
22
use League\Uri\Contracts\UriException;
23
use League\Uri\Contracts\UriInterface;
@@ -1490,6 +1491,10 @@ public function withQuery(Stringable|string|null $query): static
1490
1491
1492
public function withFragment(Stringable|string|null $fragment): static
1493
{
1494
+ if ($fragment instanceof FragmentDirective) {
1495
+ $fragment = ':~:'.$fragment->toString();
1496
+ }
1497
+
1498
$fragment = Encoder::encodeQueryOrFragment($this->filterString($fragment));
1499
1500
return match ($fragment) {
0 commit comments