Skip to content

Commit 96e03ef

Browse files
committed
Fixed static test by using escaper in block
1 parent 4585e2f commit 96e03ef

File tree

1 file changed

+14
-13
lines changed
  • app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute

1 file changed

+14
-13
lines changed

app/code/Magento/Swatches/view/adminhtml/templates/catalog/product/attribute/visual.phtml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@
77
// phpcs:disable PHPCompatibility.Miscellaneous.RemovedAlternativePHPTags.MaybeASPOpenTagFound
88
// phpcs:disable Generic.Files.LineLength.TooLong
99
/** @var $block \Magento\Swatches\Block\Adminhtml\Attribute\Edit\Options\Visual */
10+
/** @var $escaper \Magento\Framework\Escaper */
1011

1112
$stores = $block->getStoresSortedBySortOrder();
1213
?>
1314
<fieldset class="admin__fieldset fieldset">
1415
<legend class="legend">
15-
<span><?= $block->escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?></span>
16+
<span><?= $escaper->escapeHtml(__('Manage Swatch (Values of Your Attribute)')) ?></span>
1617
</legend><br />
1718
<div class="admin__control-table-wrapper" id="swatch-visual-options-panel">
1819
<table class="data-table clearfix" cellspacing="0">
1920
<thead>
2021
<tr id="swatch-visual-options-table">
2122
<th class="col-draggable"></th>
22-
<th class="col-default"><span><?= $block->escapeHtml(__('Is Default')) ?></span></th>
23-
<th><span><?= $block->escapeHtml(__('Swatch')) ?></span></th>
23+
<th class="col-default"><span><?= $escaper->escapeHtml(__('Is Default')) ?></span></th>
24+
<th><span><?= $escaper->escapeHtml(__('Swatch')) ?></span></th>
2425
<?php foreach ($stores as $_store): ?>
2526
<th<?= ($_store->getId() == \Magento\Store\Model\Store::DEFAULT_STORE_ID) ? ' class="_required"' : '' ?>>
26-
<span><?= $block->escapeHtml($_store->getName()) ?></span>
27+
<span><?= $escaper->escapeHtml($_store->getName()) ?></span>
2728
</th>
2829
<?php endforeach; ?>
2930
<?php $colTotal = count($stores) * 2 + 3; ?>
@@ -42,9 +43,9 @@ $stores = $block->getStoresSortedBySortOrder();
4243
<th colspan="<?= (int)$colTotal ?>" class="col-actions-add">
4344
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
4445
<button id="add_new_swatch_visual_option_button"
45-
title="<?= $block->escapeHtml(__('Add Swatch')) ?>"
46+
title="<?= $escaper->escapeHtml(__('Add Swatch')) ?>"
4647
type="button" class="action- scalable add">
47-
<span><?= $block->escapeHtml(__('Add Swatch')) ?></span>
48+
<span><?= $escaper->escapeHtml(__('Add Swatch')) ?></span>
4849
</button>
4950
<?php endif; ?>
5051
</th>
@@ -58,7 +59,7 @@ $stores = $block->getStoresSortedBySortOrder();
5859
<td class="col-draggable">
5960
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
6061
<div data-role="draggable-handle" class="draggable-handle"
61-
title="<?= $block->escapeHtml(__('Sort Option')) ?>"></div>
62+
title="<?= $escaper->escapeHtml(__('Sort Option')) ?>"></div>
6263
<?php endif; ?>
6364
<input data-role="order" type="hidden" name="optionvisual[order][<%- data.id %>]" value="<%- data.sort_order %>" <?= ($block->getReadOnly() || $block->canManageOptionDefaultOnly()) ? ' disabled="disabled"' : '' ?>/>
6465
</td>
@@ -72,17 +73,17 @@ $stores = $block->getStoresSortedBySortOrder();
7273
<div class="swatch_sub-menu_container" id="swatch_container_option_<%- data.id %>">
7374
<div class="swatch_row position-relative">
7475
<div class="swatch_row_name colorpicker_handler">
75-
<p><?= $block->escapeHtml(__('Choose a color')) ?></p>
76+
<p><?= $escaper->escapeHtml(__('Choose a color')) ?></p>
7677
</div>
7778
</div>
7879
<div class="swatch_row">
7980
<div class="swatch_row_name btn_choose_file_upload" id="swatch_choose_file_option_<%- data.id %>">
80-
<p><?= $block->escapeHtml(__('Upload a file')) ?></p>
81+
<p><?= $escaper->escapeHtml(__('Upload a file')) ?></p>
8182
</div>
8283
</div>
8384
<div class="swatch_row">
8485
<div class="swatch_row_name btn_remove_swatch">
85-
<p><?= $block->escapeHtml(__('Clear')) ?></p>
86+
<p><?= $escaper->escapeHtml(__('Clear')) ?></p>
8687
</div>
8788
</div>
8889
</div>
@@ -98,9 +99,9 @@ $stores = $block->getStoresSortedBySortOrder();
9899
<td id="delete_button_swatch_container_<%- data.id %>" class="col-delete">
99100
<input type="hidden" class="delete-flag" name="optionvisual[delete][<%- data.id %>]" value="" />
100101
<?php if (!$block->getReadOnly() && !$block->canManageOptionDefaultOnly()): ?>
101-
<button title="<?= $block->escapeHtml(__('Delete')) ?>" type="button"
102+
<button title="<?= $escaper->escapeHtml(__('Delete')) ?>" type="button"
102103
class="action- scalable delete delete-option">
103-
<span><?= $block->escapeHtml(__('Delete')) ?></span>
104+
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
104105
</button>
105106
<?php endif;?>
106107
</td>
@@ -112,7 +113,7 @@ $stores = $block->getStoresSortedBySortOrder();
112113
"Magento_Swatches/js/visual": <?= /* @noEscape */ $block->getJsonConfig() ?> ,
113114
"Magento_Catalog/catalog/product/attribute/unique-validate": {
114115
"element": "required-visual-swatch-unique",
115-
"message": "<?= $block->escapeHtml(__("The value of Admin must be unique.")) ?>"
116+
"message": "<?= $escaper->escapeHtml(__("The value of Admin must be unique.")) ?>"
116117
}
117118
}
118119
}

0 commit comments

Comments
 (0)