fix for empty $root

This commit is contained in:
Andy Miller 2022-03-05 11:20:54 -07:00
parent 0abde01442
commit e09bae918c
No known key found for this signature in database
GPG Key ID: 9F2CF38AEBDB0AE0

View File

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