protected function needsCaseRedirect(URLAlias $loadedUrlAlias, $requestedPath, $pathPrefix)
{
// If requested path is excluded from tree root jail, compare it to loaded UrlAlias directly.
if ($this->generator->isUriPrefixExcluded($requestedPath)) {
return strcmp($loadedUrlAlias->path, $requestedPath) !== 0;
}
// Compare loaded UrlAlias with requested path, prefixed with configured path prefix.
return strcmp($loadedUrlAlias->path, $pathPrefix . ($pathPrefix === '/' ? trim($requestedPath, '/') : rtrim($requestedPath, '/'))) !== 0;
}