Skip to content

Commit 118fccd

Browse files
committed
ACP2E-1444: [Page Builder] Product widget does not work with SKUs containing '&'
1 parent 3e5be99 commit 118fccd

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

app/code/Magento/CatalogWidget/Block/Product/ProductsList.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ protected function getConditions()
395395
? $this->getData('conditions_encoded')
396396
: $this->getData('conditions');
397397

398-
if ($conditions) {
399-
$conditions = $this->conditionsHelper->decode($conditions);
398+
if (is_string($conditions)) {
399+
$conditions = $this->decodeConditions($conditions);
400400
}
401401

402402
foreach ($conditions as $key => $condition) {
@@ -577,4 +577,16 @@ private function getWidgetPagerBlockName()
577577

578578
return $pagerBlockName . '.' . $pageName;
579579
}
580+
581+
/**
582+
* Decode encoded html special characters and unserialize the conditions into array
583+
*
584+
* @param string $encodedConditions
585+
* @return array
586+
* @see \Magento\Widget\Model\Widget::getDirectiveParam
587+
*/
588+
private function decodeConditions(string $encodedConditions): array
589+
{
590+
return $this->conditionsHelper->decode(htmlspecialchars_decode($encodedConditions));
591+
}
580592
}

0 commit comments

Comments
 (0)