Skip to content

Commit 6952aca

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-56441: Eliminate @escapeNotVerified in Product and Catalog Rules Modules
1 parent 82fac95 commit 6952aca

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

app/code/Magento/CatalogRule/view/adminhtml/templates/promo/fieldset.phtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<?php $_element = $block->getElement() ?>
1212
<?php $_jsObjectName = $block->getFieldSetId() != null ? $block->getFieldSetId() : $_element->getHtmlId() ?>
1313
<div class="rule-tree">
14-
<fieldset id="<?= /* @escapeNotVerified */ $_jsObjectName ?>" <?= /* @escapeNotVerified */ $_element->serialize(['class']) ?> class="fieldset">
15-
<legend class="legend"><span><?= /* @escapeNotVerified */ $_element->getLegend() ?></span></legend>
14+
<fieldset id="<?= $block->escapeHtmlAttr($_jsObjectName) ?>" <?= /* @noEscape */ $_element->serialize(['class']) ?> class="fieldset">
15+
<legend class="legend"><span><?= $block->escapeHtml($_element->getLegend()) ?></span></legend>
1616
<br>
1717
<?php if ($_element->getComment()): ?>
1818
<div class="messages">
@@ -30,9 +30,9 @@ require([
3030
"prototype"
3131
], function(VarienRulesForm){
3232

33-
window.<?= /* @escapeNotVerified */ $_jsObjectName ?> = new VarienRulesForm('<?= /* @escapeNotVerified */ $_jsObjectName ?>', '<?= /* @escapeNotVerified */ $block->getNewChildUrl() ?>');
33+
window.<?= $block->escapeJs($_jsObjectName) ?> = new VarienRulesForm('<?= /* @noEscape */ $_jsObjectName ?>', '<?= /* @noEscape */ $block->getNewChildUrl() ?>');
3434
<?php if ($_element->getReadonly()): ?>
35-
<?= $_element->getHtmlId() ?>.setReadonly(true);
35+
<?= /* @noEscape */ $_element->getHtmlId() ?>.setReadonly(true);
3636
<?php endif; ?>
3737

3838
});

app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ $priceElementIdPrefix = $block->getPriceElementIdPrefix() ? $block->getPriceElem
3535
?>
3636

3737
<?php if ($amount): ?>
38-
<span class="old-price map-old-price"><?= /* @escapeNotVerified */ $msrpPrice ?></span>
39-
<span class="map-fallback-price normal-price"><?= /* @escapeNotVerified */ $msrpPrice ?></span>
38+
<span class="old-price map-old-price"><?= /* @noEscape */ $msrpPrice ?></span>
39+
<span class="map-fallback-price normal-price"><?= /* @noEscape */ $msrpPrice ?></span>
4040
<?php endif; ?>
4141

4242
<?php if ($priceType->isShowPriceOnGesture()): ?>
@@ -83,26 +83,27 @@ $priceElementIdPrefix = $block->getPriceElementIdPrefix() ? $block->getPriceElem
8383
(int) $productId));
8484
}
8585
?>
86-
<span id="<?= /* @escapeNotVerified */ $block->getPriceId() ? $block->getPriceId() : $priceElementId ?>" style="display:none"></span>
86+
<span id="<?= $block->escapeHtmlAttr($block->getPriceId() ? $block->getPriceId() : $priceElementId) ?>" style="display:none"></span>
8787
<a href="javascript:void(0);"
88-
id="<?= /* @escapeNotVerified */ ($popupId) ?>"
88+
id="<?= /* @noEscape */ ($popupId) ?>"
8989
class="action map-show-info"
90-
data-mage-init='<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data) ?>'><?= /* @escapeNotVerified */ __('Click for price') ?>
90+
data-mage-init='<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data) ?>'>
91+
<?= $block->escapeHtml(__('Click for price')) ?>
9192
</a>
9293
<?php else: ?>
9394
<span class="msrp-message">
94-
<?= /* @escapeNotVerified */ $priceType->getMsrpPriceMessage() ?>
95+
<?= $block->escapeHtml($priceType->getMsrpPriceMessage()) ?>
9596
</span>
9697
<?php endif; ?>
9798

9899
<?php if ($block->getZone() == \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW): ?>
99100
<?php $helpLinkId = 'msrp-help-' . $productId . $block->getRandomString(20); ?>
100101
<a href="javascript:void(0);"
101-
id="<?= /* @escapeNotVerified */ $helpLinkId ?>"
102+
id="<?= /* @noEscape */ $helpLinkId ?>"
102103
class="action map-show-info"
103104
data-mage-init='{"addToCart":{"origin": "info",
104-
"helpLinkId": "#<?= /* @escapeNotVerified */ $helpLinkId ?>",
105+
"helpLinkId": "#<?= /* @noEscape */ $helpLinkId ?>",
105106
"productName": "<?= $block->escapeJs($block->escapeHtml($product->getName())) ?>",
106-
"closeButtonId": "#map-popup-close"}}'><span><?= /* @escapeNotVerified */ __("What's this?") ?></span>
107+
"closeButtonId": "#map-popup-close"}}'><span><?= $block->escapeHtml(__("What's this?")) ?></span>
107108
</a>
108109
<?php endif; ?>

app/code/Magento/Msrp/view/frontend/templates/cart/subtotal.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
?>
77
<div class="subtotal">
88
<span class="mark msrp">
9-
<?= /* @escapeNotVerified */ __('Order total will be displayed before you submit the order') ?>
9+
<?= $block->escapeHtml(__('Order total will be displayed before you submit the order')) ?>
1010
</span>
1111
</div>

app/code/Magento/Msrp/view/frontend/templates/cart/totals.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
// @codingStandardsIgnoreFile
88
?>
99
<div class="cart-totals">
10-
<div class="msrp totals"><?= /* @escapeNotVerified */ __('You will see the order total before you submit the order.') ?></div>
10+
<div class="msrp totals"><?= $block->escapeHtml(__('You will see the order total before you submit the order.')) ?></div>
1111
</div>

app/code/Magento/Msrp/view/frontend/templates/popup.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
<div class="map-info-price" id="map-popup-content">
2121
<div class="price-box">
2222
<div class="map-msrp" id="map-popup-msrp-box">
23-
<span class="label"><?= /* @escapeNotVerified */ __('Price') ?></span>
23+
<span class="label"><?= $block->escapeHtml(__('Price')) ?></span>
2424
<span class="old-price map-old-price" id="map-popup-msrp">
2525
<span class="price"></span>
2626
</span>
2727
</div>
2828
<div class="map-price" id="map-popup-price-box">
29-
<span class="label"><?= /* @escapeNotVerified */ __('Actual Price') ?></span>
29+
<span class="label"><?= $block->escapeHtml(__('Actual Price')) ?></span>
3030
<span id="map-popup-price" class="actual-price"></span>
3131
</div>
3232
</div>
@@ -35,15 +35,15 @@
3535
<button type="button"
3636
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
3737
class="action tocart primary">
38-
<span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
38+
<span><?= $block->escapeHtml(__('Add to Cart')) ?></span>
3939
</button>
4040
<div class="additional-addtocart-box">
4141
<?= $block->getChildHtml() ?>
4242
</div>
4343
</form>
4444
</div>
4545
<div class="map-text" id="map-popup-text">
46-
<?= /* @escapeNotVerified */ $block->getExplanationMessage() ?>
46+
<?= /* @noEscape */ $block->getExplanationMessage() ?>
4747
</div>
4848
</div>
4949
</div>
@@ -55,7 +55,7 @@
5555
</div>
5656
<div class="popup-content">
5757
<div class="map-help-text" id="map-popup-text-what-this">
58-
<?= /* @escapeNotVerified */ $block->getExplanationMessageWhatsThis() ?>
58+
<?= /* @noEscape */ $block->getExplanationMessageWhatsThis() ?>
5959
</div>
6060
</div>
6161
</div>

app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_item.phtml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,29 @@
2929
<div class="price-box msrp">
3030
<?php if ($_product->getMsrp()): ?>
3131
<?php $_msrpPrice = $pricingHelper->currency($_product->getMsrp(), true, false) ?>
32-
<span class="old-price"><?= /* @escapeNotVerified */ $_msrpPrice ?></span>
32+
<span class="old-price"><?= /* @noEscape */ $_msrpPrice ?></span>
3333
<?php endif; ?>
3434
<?php if ($_catalogHelper->isShowPriceOnGesture($_product)): ?>
3535
<?php $priceElementId = 'product-price-' . $_id . $block->getIdSuffix(); ?>
36-
<span id="<?= /* @escapeNotVerified */ $priceElementId ?>" style="display: none"></span>
36+
<span id="<?= /* @noEscape */ $priceElementId ?>" style="display: none"></span>
3737
<?php $popupId = 'msrp-popup-' . $_id . $block->getRandomString(20); ?>
3838
<a href="javascript:void(0);"
39-
id="<?= /* @escapeNotVerified */ ($popupId) ?>"
40-
data-mage-init='{"addToCart":{"popupId": "#<?= /* @escapeNotVerified */ ($popupId) ?>",
39+
id="<?= /* @noEscape */ ($popupId) ?>"
40+
data-mage-init='{"addToCart":{"popupId": "#<?= /* @noEscape */ ($popupId) ?>",
4141
"productName": "<?= /* @noEscape */ $block->escapeJs($block->escapeHtml($_product->getName())) ?>",
42-
"realPrice": <?= /* @escapeNotVerified */ $block->getRealPriceJs($_product) ?>,
43-
"msrpPrice": "<?= /* @escapeNotVerified */ $_msrpPrice ?>",
44-
"priceElementId":"<?= /* @escapeNotVerified */ $priceElementId ?>",
42+
"realPrice": <?= /* @noEscape */ $block->getRealPriceJs($_product) ?>,
43+
"msrpPrice": "<?= /* @noEscape */ $_msrpPrice ?>",
44+
"priceElementId":"<?= /* @noEscape */ $priceElementId ?>",
4545
"popupCartButtonId": "#map-popup-button",
46-
"cartForm": "#wishlist-view-form"}}'><?= /* @escapeNotVerified */ __('Click for price') ?>
46+
"cartForm": "#wishlist-view-form"}}'><?= $block->escapeHtml(__('Click for price')) ?>
4747
</a>
4848
<?php else: ?>
4949
<span class="msrp-message">
50-
<?= /* @escapeNotVerified */ $_catalogHelper->getMsrpPriceMessage($_product) ?>
50+
<?= $block->escapeHtml($_catalogHelper->getMsrpPriceMessage($_product)) ?>
5151
</span>
5252
<?php endif; ?>
5353
<?php $helpLinkId = 'msrp-help-' . $_id . $block->getRandomString(20); ?>
54-
<a href="javascript:void(0);" id="<?= /* @escapeNotVerified */ ($helpLinkId) ?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?= /* @escapeNotVerified */ ($helpLinkId) ?>", "productName": "<?= /* @noEscape */ $block->escapeJs($block->escapeHtml($_product->getName())) ?>"}}' class="link tip"><?= /* @escapeNotVerified */ __("What's this?") ?></a>
54+
<a href="javascript:void(0);" id="<?= /* @noEscape */ ($helpLinkId) ?>" data-mage-init='{"addToCart":{"helpLinkId": "#<?= /* @noEscape */ ($helpLinkId) ?>", "productName": "<?= /* @noEscape */$block->escapeJs($block->escapeHtml($_product->getName())) ?>"}}' class="link tip">
55+
<?= $block->escapeHtml(__("What's this?")) ?>
56+
</a>
5557
</div>

app/code/Magento/Msrp/view/frontend/templates/render/item/price_msrp_rss.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
?>
1717
<div class="price-box msrp">
1818
<?php if ($this->helper('Magento\Msrp\Helper\Data')->canApplyMsrp($block->getProduct())): ?>
19-
<a href="<?= /* @escapeNotVerified */ $block->getProduct()->getProductUrl() ?>"><?= /* @escapeNotVerified */ __('Click for price') ?></a>
19+
<a href="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>">
20+
<?= $block->escapeHtml(__('Click for price')) ?>
21+
</a>
2022
<?php endif; ?>
2123
</div>

0 commit comments

Comments
 (0)