Skip to content

Commit cde153b

Browse files
committed
Allow statamic URLs to use fragments/querystrings
1 parent 30d3df4 commit cde153b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Fieldtypes/Concerns/ResolvesStatamicUrls.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ trait ResolvesStatamicUrls
1313
*/
1414
protected function resolveStatamicUrls(string $content)
1515
{
16-
return preg_replace_callback('/([("])statamic:\/\/([^()"]*)([)"])/im', function ($matches) {
16+
return preg_replace_callback('/([("])statamic:\/\/([^()"?#]*)([^()"]*)([)"])/im', function ($matches) {
1717
$data = Data::find($matches[2]);
18-
$url = $data ? $data->url() : '';
18+
$url = $data ? $data->url().$matches[3] : '';
1919

20-
return $matches[1].$url.$matches[3];
20+
return $matches[1].$url.$matches[4];
2121
}, $content);
2222
}
2323
}

0 commit comments

Comments
 (0)