Skip to content

Commit b091b92

Browse files
committed
MAGETWO-99488: Eliminate @escapeNotVerified in Tax-related Modules
1 parent a1bd4d9 commit b091b92

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<input
1616
class="admin__control-text<?php if ($_store->getId() == 0): ?> required-entry<?php endif; ?>"
1717
type="text"
18-
name="title[<?= $block->escapeHtml($_store->getId()) ?>]"
18+
name="title[<?= (int)$_store->getId() ?>]"
1919
value="<?= $block->escapeHtml($_labels[$_store->getId()]) ?>" />
2020
</div>
2121
</div>

app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ require([
7676
$.ajax({
7777
type: "POST",
7878
data: {id:id},
79-
url: '<?= $block->escapeUrl($block->getTaxRateLoadUrl()) ?>',
79+
url: '<?= $block->escapeJs($block->escapeUrl($block->getTaxRateLoadUrl())) ?>',
8080
success: function(result, status) {
8181
$('body').trigger('processStop');
8282
if (result.success) {
@@ -93,14 +93,14 @@ require([
9393
});
9494
else
9595
alert({
96-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
96+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
9797
});
9898
}
9999
},
100100
error: function () {
101101
$('body').trigger('processStop');
102102
alert({
103-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
103+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
104104
});
105105
},
106106
dataType: "json"
@@ -111,7 +111,7 @@ require([
111111
var options = {
112112
mselectContainer: '#tax_rate + section.mselect-list',
113113
toggleAddButton:false,
114-
addText: '<?= $block->escapeJs(__('Add New Tax Rate')) ?>',
114+
addText: '<?= $block->escapeJs($block->escapeHtml(__('Add New Tax Rate'))) ?>',
115115
parse: null,
116116
nextPageUrl: '<?php echo $block->escapeHtml($block->getTaxRatesPageUrl())?>',
117117
selectedValues: this.settings.selected_values,
@@ -176,7 +176,7 @@ require([
176176
form_key: $('input[name="form_key"]').val()
177177
},
178178
dataType: 'json',
179-
url: '<?= $block->escapeUrl($block->getTaxRateDeleteUrl()) ?>',
179+
url: '<?= $block->escapeJs($block->escapeUrl($block->getTaxRateDeleteUrl())) ?>',
180180
success: function(result, status) {
181181
$('body').trigger('processStop');
182182
if (result.success) {
@@ -194,14 +194,14 @@ require([
194194
});
195195
else
196196
alert({
197-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
197+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
198198
});
199199
}
200200
},
201201
error: function () {
202202
$('body').trigger('processStop');
203203
alert({
204-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
204+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
205205
});
206206
}
207207
};
@@ -222,15 +222,15 @@ require([
222222
taxRateFormElement.mage('form').mage('validation');
223223

224224
taxRateForm.dialogRates({
225-
title: '<?= $block->escapeJs(__('Tax Rate')) ?>',
225+
title: '<?= $block->escapeJs($block->escapeHtml(__('Tax Rate'))) ?>',
226226
type: 'slide',
227-
id: '<?= $block->escapeJs($block->getJsId()) ?>',
227+
id: '<?= /* @noEscape */ $block->getJsId() ?>',
228228
modalClass: 'tax-rate-popup',
229229
closed: function () {
230230
taxRateFormElement.data('validation').clearError();
231231
},
232232
buttons: [{
233-
text: '<?= $block->escapeJs(__('Save')) ?>',
233+
text: '<?= $block->escapeJs($block->escapeHtml(__('Save'))) ?>',
234234
'class': 'action-save action-primary',
235235
click: function() {
236236
this.updateItemRate();
@@ -250,7 +250,7 @@ require([
250250
type: 'POST',
251251
data: itemRateData,
252252
dataType: 'json',
253-
url: '<?= $block->escapeUrl($block->getTaxRateSaveUrl()) ?>',
253+
url: '<?= $block->escapeJs($block->escapeUrl($block->getTaxRateSaveUrl())) ?>',
254254
success: function(result, status) {
255255
$('body').trigger('processStop');
256256
if (result.success) {
@@ -275,14 +275,14 @@ require([
275275
});
276276
else
277277
alert({
278-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
278+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
279279
});
280280
}
281281
},
282282
error: function () {
283283
$('body').trigger('processStop');
284284
alert({
285-
content: '<?= $block->escapeJs(__('An error occurred')) ?>'
285+
content: '<?= $block->escapeJs($block->escapeHtml(__('An error occurred'))) ?>'
286286
});
287287
}
288288
};

app/code/Magento/Weee/view/adminhtml/templates/renderer/tax.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $data = ['fptAttribute' => [
1616
?>
1717
<div id="attribute-<?= $block->getElement()->getHtmlId() ?>-container" class="field"
1818
data-attribute-code="<?= $block->getElement()->getHtmlId() ?>"
19-
data-mage-init="<?= $block->escapeHtml($this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data)) ?>">
19+
data-mage-init="<?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data) ?>">
2020
<label class="label"><span><?= $block->escapeHtml($block->getElement()->getLabel()) ?></span></label>
2121

2222
<div class="control">

app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_excl_tax.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
$_item = $block->getItem();
1010
?>
1111
<?php if ($block->displayPriceWithWeeeDetails()): ?>
12-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
12+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= (int)$_item->getId() ?>"}}'>
1313
<?php else: ?>
1414
<span class="cart-price">
1515
<?php endif; ?>
1616
<?= /* @noEscape */ $block->formatPrice($block->getRowDisplayPriceExclTax()) ?>
1717
</span>
1818

1919
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?>
20-
<span class="cart-tax-info" id="esubtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>" style="display: none;">
20+
<span class="cart-tax-info" id="esubtotal-item-tax-details<?= (int)$_item->getId() ?>" style="display: none;">
2121
<?php if ($block->displayPriceWithWeeeDetails()): ?>
2222
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?>
2323
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>"><?= /* @noEscape */ $block->formatPrice($tax['row_amount'], true, true) ?></span>
@@ -26,7 +26,7 @@ $_item = $block->getItem();
2626
</span>
2727

2828
<?php if ($block->displayFinalPrice()): ?>
29-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
29+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= (int)$_item->getId() ?>"}}'>
3030
<span class="weee" data-label="<?= $block->escapeHtml(__('Total')) ?>">
3131
<?= /* @noEscape */ $block->formatPrice($block->getFinalRowDisplayPriceExclTax()) ?>
3232
</span>

app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/row_incl_tax.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data');
1212
?>
1313
<?php $_incl = $_item->getRowTotalInclTax(); ?>
1414
<?php if ($block->displayPriceWithWeeeDetails()): ?>
15-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
15+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= (int)$_item->getId() ?>"}}'>
1616
<?php else: ?>
1717
<span class="cart-price">
1818
<?php endif; ?>
1919
<?= /* @noEscape */ $block->formatPrice($block->getRowDisplayPriceInclTax()) ?>
2020
</span>
2121

2222
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?>
23-
<span class="cart-tax-info" id="subtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>" style="display: none;">
23+
<span class="cart-tax-info" id="subtotal-item-tax-details<?= (int)$_item->getId() ?>" style="display: none;">
2424
<?php if ($block->displayPriceWithWeeeDetails()): ?>
2525
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?>
2626
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>"><?= /* @noEscape */ $block->formatPrice($tax['row_amount_incl_tax'], true, true) ?></span>
@@ -29,7 +29,7 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data');
2929
</span>
3030

3131
<?php if ($block->displayFinalPrice()): ?>
32-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
32+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= (int)$_item->getId() ?>"}}'>
3333
<span class="weee" data-label="<?= $block->escapeHtml(__('Total Incl. Tax')) ?>">
3434
<?= /* @noEscape */ $block->formatPrice($block->getFinalRowDisplayPriceInclTax()) ?>
3535
</span>

app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_excl_tax.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$_item = $block->getItem();
1010
?>
1111
<?php if ($block->displayPriceWithWeeeDetails()): ?>
12-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#eunit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
12+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#eunit-item-tax-details<?= (int)$_item->getId() ?>"}}'>
1313
<?php else: ?>
1414
<span class="cart-price">
1515
<?php endif; ?>
@@ -18,7 +18,7 @@ $_item = $block->getItem();
1818
</span>
1919

2020
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?>
21-
<span class="cart-tax-info" id="eunit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>" style="display:none;">
21+
<span class="cart-tax-info" id="eunit-item-tax-details<?= (int)$_item->getId() ?>" style="display:none;">
2222
<?php if ($block->displayPriceWithWeeeDetails()): ?>
2323
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?>
2424
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>"><?= /* @noEscape */ $block->formatPrice($tax['amount'], true, true) ?></span>
@@ -27,7 +27,7 @@ $_item = $block->getItem();
2727
</span>
2828

2929
<?php if ($block->displayFinalPrice()): ?>
30-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#eunit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
30+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#eunit-item-tax-details<?= (int)$_item->getId() ?>"}}'>
3131
<span class="weee" data-label="<?= $block->escapeHtml(__('Total')) ?>">
3232
<?= /* @noEscape */ $block->formatPrice($block->getFinalUnitDisplayPriceExclTax()) ?>
3333
</span>

app/code/Magento/Weee/view/frontend/templates/checkout/onepage/review/item/price/unit_incl_tax.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data');
1212
?>
1313
<?php $_incl = $_item->getPriceInclTax(); ?>
1414
<?php if ($block->displayPriceWithWeeeDetails()): ?>
15-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#unit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
15+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#unit-item-tax-details<?= (int)$_item->getId() ?>"}}'>
1616
<?php else: ?>
1717
<span class="cart-price">
1818
<?php endif; ?>
@@ -21,7 +21,7 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data');
2121
</span>
2222

2323
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item)): ?>
24-
<span class="cart-tax-info" id="unit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>" style="display: none;">
24+
<span class="cart-tax-info" id="unit-item-tax-details<?= (int)$_item->getId() ?>" style="display: none;">
2525
<?php if ($block->displayPriceWithWeeeDetails()): ?>
2626
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($_item) as $tax): ?>
2727
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>"><?= /* @noEscape */ $block->formatPrice($tax['amount_incl_tax'], true, true) ?></span>
@@ -30,7 +30,7 @@ $_weeeHelper = $this->helper('Magento\Weee\Helper\Data');
3030
</span>
3131

3232
<?php if ($block->displayFinalPrice()): ?>
33-
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#unit-item-tax-details<?= $block->escapeHtml($_item->getId()) ?>"}}'>
33+
<span class="cart-tax-total" data-mage-init='{"taxToggle": {"itemTaxId" : "#unit-item-tax-details<?= (int)$_item->getId() ?>"}}'>
3434
<span class="weee" data-label="<?= $block->escapeHtml(__('Total Incl. Tax')) ?>">
3535
<?= /* @noEscape */ $block->formatPrice($block->getFinalUnitDisplayPriceInclTax()) ?>
3636
</span>

app/code/Magento/Weee/view/frontend/templates/item/price/row.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ $item = $block->getItem();
1212
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
1313
<?php if ($block->displayPriceWithWeeeDetails()): ?>
1414
<span class="cart-tax-total"
15-
data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>"}}'>
15+
data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= (int)$item->getId() ?>"}}'>
1616
<?php else: ?>
1717
<span class="cart-price">
1818
<?php endif; ?>
1919
<?= /* @noEscape */ $block->formatPrice($block->getRowDisplayPriceInclTax()) ?>
2020
</span>
2121

2222
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?>
23-
<div class="cart-tax-info" id="subtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>" style="display: none;">
23+
<div class="cart-tax-info" id="subtotal-item-tax-details<?= (int)$item->getId() ?>" style="display: none;">
2424
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
2525
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>">
2626
<?= /* @noEscape */ $block->formatPrice($tax['row_amount_incl_tax'], true, true) ?>
@@ -30,7 +30,7 @@ $item = $block->getItem();
3030

3131
<?php if ($block->displayFinalPrice()): ?>
3232
<span class="cart-tax-total"
33-
data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>"}}'>
33+
data-mage-init='{"taxToggle": {"itemTaxId" : "#subtotal-item-tax-details<?= (int)$item->getId() ?>"}}'>
3434
<span class="weee" data-label="<?= $block->escapeHtml(__('Total Incl. Tax')) ?>">
3535
<?= /* @noEscape */ $block->formatPrice($block->getFinalRowDisplayPriceInclTax()) ?>
3636
</span>
@@ -44,15 +44,15 @@ $item = $block->getItem();
4444
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
4545
<?php if ($block->displayPriceWithWeeeDetails()): ?>
4646
<span class="cart-tax-total"
47-
data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>"}}'>
47+
data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= (int)$item->getId() ?>"}}'>
4848
<?php else: ?>
4949
<span class="cart-price">
5050
<?php endif; ?>
5151
<?= /* @noEscape */ $block->formatPrice($block->getRowDisplayPriceExclTax()) ?>
5252
</span>
5353

5454
<?php if ($this->helper('Magento\Weee\Helper\Data')->getApplied($item)): ?>
55-
<span class="cart-tax-info" id="esubtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>"
55+
<span class="cart-tax-info" id="esubtotal-item-tax-details<?= (int)$item->getId() ?>"
5656
style="display: none;">
5757
<?php foreach ($this->helper('Magento\Weee\Helper\Data')->getApplied($item) as $tax): ?>
5858
<span class="weee" data-label="<?= $block->escapeHtml($tax['title']) ?>">
@@ -63,7 +63,7 @@ $item = $block->getItem();
6363

6464
<?php if ($block->displayFinalPrice()): ?>
6565
<span class="cart-tax-total"
66-
data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= $block->escapeHtml($item->getId()) ?>"}}'>
66+
data-mage-init='{"taxToggle": {"itemTaxId" : "#esubtotal-item-tax-details<?= (int)$item->getId() ?>"}}'>
6767
<span class="weee" data-label="<?= $block->escapeHtml(__('Total')) ?>">
6868
<?= /* @noEscape */ $block->formatPrice($block->getFinalRowDisplayPriceExclTax()) ?>
6969
</span>

0 commit comments

Comments
 (0)