File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
app/code/Magento/CatalogWidget/Block/Product Expand file tree Collapse file tree 1 file changed +14
-2
lines changed 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 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}
You can’t perform that action at this time.
0 commit comments