/**
* Returns true of false on comparing $urlAlias->path and $path with case sensitivity.
*
* Used to determine if redirect is needed because requested path is case-different
* from the stored one.
*
* @param \eZ\Publish\API\Repository\Values\Content\URLAlias $loadedUrlAlias
* @param string $requestedPath
* @param string $pathPrefix
*
* @return bool
*/
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;
}