Skip to content

Commit 7600c7c

Browse files
author
Burlacu Vasilii
committed
product attribute - deny HTML tags for labels
1 parent ac3eb00 commit 7600c7c

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

app/code/Magento/Catalog/view/adminhtml/templates/catalog/product/attribute/labels.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<?php $_labels = $block->getLabelValues() ?>
3030
<?php foreach ($block->getStores() as $_store) :?>
3131
<td class="col-store-view">
32-
<input class="input-text<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) :?> required-option<?php endif; ?>"
32+
<input class="input-text validate-no-html-tags<?php if ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) :?> required-option<?php endif; ?>"
3333
type="text"
3434
name="frontend_label[<?= $block->escapeHtmlAttr($_store->getId()) ?>]"
3535
value="<?= $block->escapeHtmlAttr($_labels[$_store->getId()]) ?>"

app/code/Magento/Catalog/view/adminhtml/ui_component/product_attribute_add_form.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<required>true</required>
6464
<validation>
6565
<rule name="required-entry" xsi:type="boolean">true</rule>
66+
<rule name="validate-no-html-tags" xsi:type="boolean">true</rule>
6667
</validation>
6768
<dataType>string</dataType>
6869
<label translate="true">Attribute Label</label>

app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ protected function _prepareForm()
130130
'label' => __('Default Label'),
131131
'title' => __('Default label'),
132132
'required' => true,
133-
'value' => is_array($labels) ? $labels[0] : $labels
133+
'value' => is_array($labels) ? $labels[0] : $labels,
134+
'class' => 'validate-no-html-tags',
134135
]
135136
);
136137

0 commit comments

Comments
 (0)