Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Checked for string lenght when determining to skip matching request. …
Browse files Browse the repository at this point in the history
…This fixes a warning for 'short' requests paths
  • Loading branch information
Edwin Jacobs committed Nov 2, 2020
1 parent e603802 commit 216ee16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Model/Catalog/Layer/Url/Strategy/PathSlugStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ protected function skip(MagentoHttpRequest $request): bool
{
$requestPath = $request->getPathInfo();
foreach ($this->skipMatchExtensions as $fileExtension) {
// Check for string length of the request path.
if (strlen($requestPath) <= strlen($fileExtension)) {
continue;
}
if (strpos($requestPath, $fileExtension, -\strlen($fileExtension)) !== false) {
return true;
}
Expand Down

0 comments on commit 216ee16

Please sign in to comment.