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

Commit

Permalink
Sanitized filters with strtolower as the attribute map construction a…
Browse files Browse the repository at this point in the history
…pplies a strtolower
  • Loading branch information
Edwin Jacobs committed Jan 31, 2020
1 parent 06c6ff3 commit 3d7e52d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,15 @@ protected function buildFilterHash(array $filters, int $categoryId = null)
return null;
}

foreach ($filters as $key => $filterValues) {
$sanitizedFilters = array_map('strtolower', $filterValues);
$filters[$key] = $sanitizedFilters;
}

if ($categoryId !== null && !$this->isRootCategory($categoryId)) {
$filters['category'] = $categoryId;
}

ksort($filters);
return md5(json_encode($filters));
}
Expand Down Expand Up @@ -231,4 +237,4 @@ public function buildCanonicalUrl(Emico_Tweakwise_Model_Catalog_Layer $state)
{
return $this->buildUrl($state);
}
}
}

0 comments on commit 3d7e52d

Please sign in to comment.