File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
CatalogRule/Controller/Adminhtml/Promo/Catalog Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ public function execute()
78
78
unset($ data ['rule ' ]);
79
79
}
80
80
81
+ unset($ data ['conditions_serialized ' ]);
82
+ unset($ data ['actions_serialized ' ]);
83
+
81
84
$ model ->loadPost ($ data );
82
85
83
86
$ this ->_objectManager ->get ('Magento\Backend\Model\Session ' )->setPageData ($ data );
Original file line number Diff line number Diff line change 8
8
use Magento \Framework \Data \Form \Element \Renderer \RendererInterface ;
9
9
use Magento \Framework \View \Element \AbstractBlock ;
10
10
11
+ /**
12
+ * Renderer for Editable sales rules
13
+ */
11
14
class Editable extends AbstractBlock implements RendererInterface
12
15
{
13
16
/**
@@ -48,15 +51,15 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
48
51
49
52
if ($ element ->getShowAsText ()) {
50
53
$ html = ' <input type="hidden" class="hidden" id=" ' .
51
- $ element ->getHtmlId () .
54
+ $ this -> escapeHtmlAttr ( $ element ->getHtmlId () ) .
52
55
'" name=" ' .
53
- $ element ->getName () .
56
+ $ this -> escapeHtmlAttr ( $ element ->getName () ) .
54
57
'" value=" ' .
55
- $ element ->getValue () .
58
+ $ this -> escapeHtmlAttr ( $ element ->getValue () ) .
56
59
'" data-form-part=" ' .
57
- $ element ->getData ('data-form-part ' ) .
60
+ $ this -> escapeHtmlAttr ( $ element ->getData ('data-form-part ' ) ) .
58
61
'"/> ' .
59
- htmlspecialchars (
62
+ $ this -> escapeHtml (
60
63
$ valueName
61
64
) . ' ' ;
62
65
} else {
@@ -92,4 +95,15 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
92
95
93
96
return $ html ;
94
97
}
98
+
99
+ /**
100
+ * Escape html attribute
101
+ *
102
+ * @param string\null $attribute
103
+ * @return string
104
+ */
105
+ private function escapeHtmlAttr ($ attribute )
106
+ {
107
+ return $ attribute ? $ this ->_escaper ->escapeHtmlAttr ($ attribute ) : $ attribute ;
108
+ }
95
109
}
You can’t perform that action at this time.
0 commit comments