File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
CatalogWidget/Block/Product Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1484
1484
<requiredEntity type =" product_extension_attribute" >EavStockItem</requiredEntity >
1485
1485
<requiredEntity type =" custom_attribute_array" >CustomAttributeCategoryIds</requiredEntity >
1486
1486
</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& 01</data >
1490
+ </entity >
1491
+ </entities >
Original file line number Diff line number Diff line change @@ -395,8 +395,8 @@ protected function getConditions()
395
395
? $ this ->getData ('conditions_encoded ' )
396
396
: $ this ->getData ('conditions ' );
397
397
398
- if ($ conditions ) {
399
- $ conditions = $ this ->conditionsHelper -> decode ($ conditions );
398
+ if (is_string ( $ conditions) ) {
399
+ $ conditions = $ this ->decodeConditions ($ conditions );
400
400
}
401
401
402
402
foreach ($ conditions as $ key => $ condition ) {
@@ -577,4 +577,16 @@ private function getWidgetPagerBlockName()
577
577
578
578
return $ pagerBlockName . '. ' . $ pageName ;
579
579
}
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
+ }
580
592
}
You can’t perform that action at this time.
0 commit comments