Skip to content

Commit 6974929

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

File tree

22 files changed

+105
-89
lines changed

22 files changed

+105
-89
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
@@ -16,7 +16,7 @@
1616
class="admin__control-text<?php if ($_store->getId() == 0): ?> required-entry<?php endif; ?>"
1717
type="text"
1818
name="title[<?= (int)$_store->getId() ?>]"
19-
value="<?= $block->escapeHtml($_labels[$_store->getId()]) ?>" />
19+
value="<?= $block->escapeHtmlAttr($_labels[$_store->getId()]) ?>" />
2020
</div>
2121
</div>
2222
<?php endforeach; ?>

app/code/Magento/Tax/view/adminhtml/templates/rule/rate/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="grid-loader"></div>
1111
</div>
1212

13-
<div class="form-inline" id="<?= $block->escapeHtml($block->getNameInLayout()) ?>" style="display:none">
13+
<div class="form-inline" id="<?= $block->escapeHtmlAttr($block->getNameInLayout()) ?>" style="display:none">
1414
<?= $block->getFormHtml() ?>
1515
<?= $block->getChildHtml('form_after') ?>
1616
</div>

app/code/Magento/Tax/view/base/templates/pricing/adjustment.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<?php if ($block->displayBothPrices()): ?>
1111
<span id="<?= /* @noEscape */ $block->buildIdWithPrefix('price-excluding-tax-') ?>"
12-
data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>"
12+
data-label="<?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>"
1313
data-price-amount="<?= /* @noEscape */ $block->getRawAmount() ?>"
1414
data-price-type="basePrice"
1515
class="price-wrapper price-excluding-tax">

app/code/Magento/Tax/view/frontend/templates/checkout/cart/item/price/sidebar.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
?>
99
<?php $_item = $block->getItem() ?>
1010
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
11-
<span class="price-wrapper price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
11+
<span class="price-wrapper price-including-tax" data-label="<?= $block->escapeHtmlAttr(__('Incl. Tax')) ?>">
1212
<?php $_incl = $_item->getPriceInclTax(); ?>
1313
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_incl) ?>
1414
</span>
1515
<?php endif; ?>
1616
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
17-
<span class="price-wrapper price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
17+
<span class="price-wrapper price-excluding-tax" data-label="<?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>">
1818
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_item->getCalculationPrice()) ?>
1919
</span>
2020
<?php endif; ?>

app/code/Magento/Tax/view/frontend/templates/checkout/grandtotal.phtml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,33 @@
99
*/
1010
?>
1111
<?php if ($block->includeTax() && $block->getTotalExclTax() >= 0):?>
12+
<?php
13+
$style = $block->escapeHtmlAttr($block->getStyle());
14+
$colspan = (int)$block->getColspan();
15+
?>
1216
<tr class="grand totals excl">
13-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
17+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
1418
<strong><?= $block->escapeHtml(__('Grand Total Excl. Tax')) ?></strong>
1519
</th>
16-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Grand Total Excl. Tax')) ?>">
20+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr(__('Grand Total Excl. Tax')) ?>">
1721
<strong><?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotalExclTax()) ?></strong>
1822
</td>
1923
</tr>
20-
<?= /* @noEscape */ $block->renderTotals('taxes', $block->getColspan()) ?>
24+
<?= /* @noEscape */ $block->renderTotals('taxes', $colspan) ?>
2125
<tr class="grand totals incl">
22-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
26+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
2327
<strong><?= $block->escapeHtml(__('Grand Total Incl. Tax')) ?></strong>
2428
</th>
25-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Grand Total Incl. Tax')) ?>">
29+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr(__('Grand Total Incl. Tax')) ?>">
2630
<strong><?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValue()) ?></strong>
2731
</td>
2832
</tr>
2933
<?php else:?>
3034
<tr class="grand totals">
31-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
35+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
3236
<strong><?= $block->escapeHtml($block->getTotal()->getTitle()) ?></strong>
3337
</th>
34-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
38+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
3539
<strong><?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValue()) ?></strong>
3640
</td>
3741
</tr>

app/code/Magento/Tax/view/frontend/templates/checkout/shipping.phtml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,42 @@
1010
*/
1111
?>
1212
<?php if ($block->displayShipping()):?>
13+
<?php
14+
$style = $block->escapeHtmlAttr($block->getStyle());
15+
$colspan = (int)$block->getColspan();
16+
?>
1317
<?php if ($block->displayBoth()):?>
1418
<tr class="totals shipping excl">
15-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
19+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
1620
<?= $block->escapeHtml($block->getExcludeTaxLabel()) ?>
1721
</th>
18-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getExcludeTaxLabel()) ?>">
22+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getExcludeTaxLabel()) ?>">
1923
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingExcludeTax()) ?>
2024
</td>
2125
</tr>
2226
<tr class="totals shipping incl">
23-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
27+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
2428
<?= $block->escapeHtml($block->getIncludeTaxLabel()) ?>
2529
</th>
26-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getIncludeTaxLabel()) ?>">
30+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getIncludeTaxLabel()) ?>">
2731
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingIncludeTax()) ?>
2832
</td>
2933
</tr>
3034
<?php elseif ($block->displayIncludeTax()) : ?>
3135
<tr class="totals shipping incl">
32-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
36+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
3337
<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>
3438
</th>
35-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
39+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
3640
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingIncludeTax()) ?>
3741
</td>
3842
</tr>
3943
<?php else:?>
4044
<tr class="totals shipping excl">
41-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
45+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
4246
<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>
4347
</th>
44-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
48+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
4549
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getShippingExcludeTax()) ?>
4650
</td>
4751
</tr>

app/code/Magento/Tax/view/frontend/templates/checkout/shipping/price.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
<span class="price"><?= /* @noEscape */ $_excl ?></span>
1313
<?php else: ?>
1414
<?php if ($block->displayShippingBothPrices() && $_incl != $_excl): ?>
15-
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
15+
<span class="price-including-tax" data-label="<?= $block->escapeHtmlAttr(__('Incl. Tax')) ?>">
1616
<?php endif; ?>
1717
<span class="price"><?= /* @noEscape */ $_incl ?></span>
1818
<?php if ($block->displayShippingBothPrices() && $_incl != $_excl): ?>
1919
</span>
2020
<?php endif; ?>
2121
<?php endif; ?>
2222
<?php if ($block->displayShippingBothPrices() && $_incl != $_excl): ?>
23-
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>"><span class="price"><?= /* @noEscape */ $_excl ?></span></span>
23+
<span class="price-excluding-tax" data-label="<?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>"><span class="price"><?= /* @noEscape */ $_excl ?></span></span>
2424
<?php endif; ?>

app/code/Magento/Tax/view/frontend/templates/checkout/subtotal.phtml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,33 @@
99
* @see \Magento\Tax\Block\Checkout\Subtotal
1010
*/
1111
?>
12-
<?php if ($block->displayBoth()):?>
12+
<?php if ($block->displayBoth()) :?>
13+
<?php
14+
$style = $block->escapeHtmlAttr($block->getStyle());
15+
$colspan = (int)$block->getColspan();
16+
?>
1317
<tr class="totals sub excl">
14-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
18+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
1519
<?= $block->escapeHtml(__('Subtotal (Excl. Tax)')) ?>
1620
</th>
17-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Subtotal (Excl. Tax)')) ?>">
21+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr(__('Subtotal (Excl. Tax)')) ?>">
1822
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValueExclTax()) ?>
1923
</td>
2024
</tr>
2125
<tr class="totals sub incl">
22-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
26+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
2327
<?= $block->escapeHtml(__('Subtotal (Incl. Tax)')) ?>
2428
</th>
25-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml(__('Subtotal (Incl. Tax)')) ?>">
29+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr(__('Subtotal (Incl. Tax)')) ?>">
2630
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValueInclTax()) ?>
2731
</td>
2832
</tr>
2933
<?php else : ?>
3034
<tr class="totals sub">
31-
<th style="<?= /* @noEscape */ $block->getStyle() ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
35+
<th style="<?= /* @noEscape */ $style ?>" class="mark" colspan="<?= /* @noEscape */ $colspan ?>" scope="row">
3236
<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>
3337
</th>
34-
<td style="<?= /* @noEscape */ $block->getStyle() ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
38+
<td style="<?= /* @noEscape */ $style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
3539
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($block->getTotal()->getValue()) ?>
3640
</td>
3741
</tr>

app/code/Magento/Tax/view/frontend/templates/checkout/tax.phtml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
?>
1212
<?php
1313
$_value = $block->getTotal()->getValue();
14-
$_style = $block->getTotal()->getStyle();
14+
$_style = $block->escapeHtmlAttr($block->getTotal()->getStyle());
1515
?>
1616
<?php global $taxIter; $taxIter++; ?>
1717

@@ -23,14 +23,14 @@
2323
?>
2424

2525
<tr <?= /* @noEscape */ $attributes ?>>
26-
<th style="<?= /* @noEscape */ $_style ?>" class="mark" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
26+
<th style="<?= /* @noEscape */ $_style ?>" class="mark" colspan="<?= (int)$block->getColspan() ?>" scope="row">
2727
<?php if ($this->helper('Magento\Tax\Helper\Data')->displayFullSummary()): ?>
2828
<span class="detailed"><?= $block->escapeHtml($block->getTotal()->getTitle()) ?></span>
2929
<?php else: ?>
3030
<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>
3131
<?php endif;?>
3232
</th>
33-
<td style="<?= /* @noEscape */ $_style ?>" class="amount" data-th="<?= $block->escapeHtml($block->getTotal()->getTitle()) ?>">
33+
<td style="<?= /* @noEscape */ $_style ?>" class="amount" data-th="<?= $block->escapeHtmlAttr($block->getTotal()->getTitle()) ?>">
3434
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($_value) ?>
3535
</td>
3636
</tr>
@@ -47,15 +47,15 @@
4747

4848
<?php foreach ($rates as $rate): ?>
4949
<tr class="totals-tax-details details-<?= /* @noEscape */ $taxIter ?>">
50-
<th class="mark" style="<?= /* @noEscape */ $_style ?>" colspan="<?= /* @noEscape */ $block->getColspan() ?>" scope="row">
50+
<th class="mark" style="<?= /* @noEscape */ $_style ?>" colspan="<?= (int)$block->getColspan() ?>" scope="row">
5151
<?= $block->escapeHtml($rate['title']) ?>
5252
<?php if (!is_null($rate['percent'])): ?>
5353
(<?= (float)$rate['percent'] ?>%)
5454
<?php endif; ?>
5555
</th>
5656
<?php if ($isFirst): ?>
5757
<td style="<?= /* @noEscape */ $_style ?>" class="amount" rowspan="<?= count($rates) ?>"
58-
data-th="<?= $block->escapeHtml($rate['title']) ?><?php if (!is_null($rate['percent'])): ?>(<?= (float)$rate['percent'] ?>%)<?php endif; ?>">
58+
data-th="<?= $block->escapeHtmlAttr($rate['title']) ?><?php if (!is_null($rate['percent'])): ?>(<?= (float)$rate['percent'] ?>%)<?php endif; ?>">
5959
<?= /* @noEscape */ $this->helper('Magento\Checkout\Helper\Data')->formatPrice($amount) ?>
6060
</td>
6161
<?php endif; ?>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
$_item = $block->getItem();
1010
?>
1111
<?php if (($block->displayPriceInclTax() || $block->displayBothPrices()) && !$_item->getNoSubtotal()): ?>
12-
<span class="price-including-tax" data-label="<?= $block->escapeHtml(__('Incl. Tax')) ?>">
12+
<span class="price-including-tax" data-label="<?= $block->escapeHtmlAttr(__('Incl. Tax')) ?>">
1313
<span class="cart-price">
1414
<?= /* @noEscape */ $block->formatPrice($_item->getRowTotalInclTax()) ?>
1515
</span>
1616
</span>
1717
<?php endif; ?>
1818

1919
<?php if (($block->displayPriceExclTax() || $block->displayBothPrices()) && !$_item->getNoSubtotal()): ?>
20-
<span class="price-excluding-tax" data-label="<?= $block->escapeHtml(__('Excl. Tax')) ?>">
20+
<span class="price-excluding-tax" data-label="<?= $block->escapeHtmlAttr(__('Excl. Tax')) ?>">
2121
<span class="cart-price">
2222
<?= /* @noEscape */ $block->formatPrice($_item->getRowTotal()) ?>
2323
</span>

0 commit comments

Comments
 (0)