Skip to content

Commit

Permalink
Merge pull request #1999 from rbayet/fix_1978_filter_special_characte…
Browse files Browse the repository at this point in the history
…rs_prevent_removal_2_8_x

Fixes #1978 Do not rely on escaped value to compare
  • Loading branch information
rbayet authored Nov 18, 2020
2 parents d398e7f + f260af9 commit fdf48c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public function apply(\Magento\Framework\App\RequestInterface $request)

foreach ($this->currentFilterValue as $currentFilter) {
$filter = $this->_createItem($this->escaper->escapeHtml($currentFilter), $this->currentFilterValue);
$filter->setRawValue($currentFilter);
$layerState->addFilter($filter);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getRemoveUrl()
$query = [$this->getFilter()->getRequestVar() => $this->getFilter()->getResetValue()];

if (is_array($this->getApplyValue())) {
$resetValue = array_diff($this->getApplyValue(), [$this->getLabel()]);
$resetValue = array_diff($this->getApplyValue(), [$this->getRawValue() ?? $this->getLabel()]);
if (count($resetValue) < 2) {
$resetValue = current($resetValue);
}
Expand Down

0 comments on commit fdf48c5

Please sign in to comment.