Skip to content

Commit 5feff93

Browse files
committed
Merge branch 'ACP2E-1444' of https://github.com/magento-l3/magento2ce into PR-L3-2023-01-31
2 parents 4acfde7 + db179e8 commit 5feff93

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,5 +1484,8 @@
14841484
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
14851485
<requiredEntity type="custom_attribute_array">CustomAttributeCategoryIds</requiredEntity>
14861486
</entity>
1487-
1488-
</entities>
1487+
<entity name="ProductWithSpecialCharsInSKU" extends="SimpleProduct" type="product">
1488+
<data key="name">Simple Product with special characters in SKU</data>
1489+
<data key="sku">s000&amp;01</data>
1490+
</entity>
1491+
</entities>

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 special characters and unserialize 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)