Skip to content

Commit 6b9224c

Browse files
committed
MAGETWO-96759: Fixed incorrect displaying of the sales rule conditions
1 parent 1815df9 commit 6b9224c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

app/code/Magento/Rule/Block/Editable.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
use Magento\Framework\View\Element\AbstractBlock;
1010

1111
/**
12+
* Renderer for Editable sales rules.
13+
*
1214
* @api
1315
* @since 100.0.2
1416
*/
@@ -52,9 +54,9 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
5254

5355
if ($element->getShowAsText()) {
5456
$html = ' <input type="hidden" class="hidden" id="' .
55-
$element->getHtmlId() .
57+
$this->escapeHtmlAttr($element->getHtmlId()) .
5658
'" name="' .
57-
$element->getName() .
59+
$this->escapeHtmlAttr($element->getName()) .
5860
'" value="' .
5961
$element->getValue() .
6062
'" data-form-part="' .

lib/internal/Magento/Framework/Data/Form/Element/AbstractElement.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,11 @@ public function setId($id)
170170
*/
171171
public function getHtmlId()
172172
{
173-
return $this->getForm()->getHtmlIdPrefix() . $this->getData('html_id') . $this->getForm()->getHtmlIdSuffix();
173+
return $this->_escaper->escapeHtml(
174+
$this->getForm()->getHtmlIdPrefix() .
175+
$this->getData('html_id') .
176+
$this->getForm()->getHtmlIdSuffix()
177+
);
174178
}
175179

176180
/**
@@ -184,7 +188,7 @@ public function getName()
184188
if ($suffix = $this->getForm()->getFieldNameSuffix()) {
185189
$name = $this->getForm()->addSuffixToName($name, $suffix);
186190
}
187-
return $name;
191+
return $this->_escaper->escapeHtml($name);
188192
}
189193

190194
/**

0 commit comments

Comments
 (0)