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 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& 01</data >
1490+ </entity >
1491+ </entities >
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments