Escape root url pattern in Utils::url()

This commit is contained in:
Matias Griese 2022-03-09 12:25:46 +02:00
parent c7bc5f5b59
commit 4d4efb31e3

View File

@ -134,7 +134,7 @@ abstract class Utils
$resource = $locator->findResource($input, false);
}
} else {
$root = $uri->rootUrl();
$root = preg_quote($uri->rootUrl(), '#');
$pattern = '#(' . $root . '$|' . $root . '/)#';
if (!empty($root) && preg_match($pattern, $input, $matches)) {
$input = static::replaceFirstOccurrence($matches[0], '', $input);