Skip to content

Commit 514e3d0

Browse files
authored
Merge pull request #4272 from magento-obsessive-owls/MAGETWO-55806
[Owls] MAGETWO-55806: Eliminate @escapeNotVerified in Tax-related Modules
2 parents db740df + de38bd1 commit 514e3d0

File tree

47 files changed

+650
-692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+650
-692
lines changed

app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,28 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<?php
1110
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
1211

1312
$_item = $block->getItem();
1413
?>
15-
16-
<?php if ($block->displayBothPrices() || $block->displayPriceExclTax()): ?>
14+
<?php if ($block->displayBothPrices() || $block->displayPriceExclTax()) : ?>
1715
<div class="price-excl-tax">
18-
<?php if ($block->displayBothPrices()): ?>
19-
<span class="label"><?= /* @escapeNotVerified */ __('Excl. Tax') ?>:</span>
16+
<?php if ($block->displayBothPrices()) : ?>
17+
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
2018
<?php endif; ?>
21-
<?= /* @escapeNotVerified */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
19+
<?= /* @noEscape */ $block->displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
2220
</div>
2321
<?php endif; ?>
24-
<?php if ($block->displayBothPrices() || $block->displayPriceInclTax()): ?>
22+
<?php if ($block->displayBothPrices() || $block->displayPriceInclTax()) : ?>
2523
<div class="price-incl-tax">
26-
<?php if ($block->displayBothPrices()): ?>
27-
<span class="label"><?= /* @escapeNotVerified */ __('Incl. Tax') ?>:</span>
24+
<?php if ($block->displayBothPrices()) : ?>
25+
<span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2826
<?php endif; ?>
29-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?>
30-
<?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBaseSubtotalInclTax($_item); ?>
31-
<?= /* @escapeNotVerified */ $block->displayPrices($_baseIncl, $_incl) ?>
27+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?>
28+
<?php $_baseIncl = $this->helper(\Magento\Checkout\Helper\Data::class)->getBaseSubtotalInclTax($_item); ?>
29+
<?= /* @noEscape */ $block->displayPrices($_baseIncl, $_incl) ?>
3230
</div>
3331
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/items/price/total.phtml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php
118
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
129

1310
$_item = $block->getItem();
1411
?>
1512

16-
<?= /* @escapeNotVerified */ $block->displayPrices($block->getBaseTotalAmount($_item), $block->getTotalAmount($_item)) ?>
13+
<?= /* @noEscape */ $block->displayPrices($block->getBaseTotalAmount($_item), $block->getTotalAmount($_item)) ?>

app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,32 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<?php
1110
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
1211

1312
$_item = $block->getItem();
1413
?>
1514

16-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceExclTax()): ?>
15+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceExclTax()) : ?>
1716
<div class="price-excl-tax">
18-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?>
19-
<span class="label"><?= /* @escapeNotVerified */ __('Excl. Tax') ?>:</span>
17+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?>
18+
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
2019
<?php endif; ?>
2120

22-
<?= /* @escapeNotVerified */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
21+
<?= /* @noEscape */ $block->displayPrices($_item->getBasePrice(), $_item->getPrice()) ?>
2322
</div>
2423
<?php endif; ?>
25-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices() || $this->helper('Magento\Tax\Helper\Data')->displaySalesPriceInclTax()): ?>
24+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceInclTax()) : ?>
2625
<div class="price-incl-tax">
27-
<?php if ($this->helper('Magento\Tax\Helper\Data')->displaySalesBothPrices()): ?>
28-
<span class="label"><?= /* @escapeNotVerified */ __('Incl. Tax') ?>:</span>
26+
<?php if ($this->helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?>
27+
<span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2928
<?php endif; ?>
30-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?>
31-
<?php $_baseIncl = $this->helper('Magento\Checkout\Helper\Data')->getBasePriceInclTax($_item); ?>
29+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?>
30+
<?php $_baseIncl = $this->helper(\Magento\Checkout\Helper\Data::class)->getBasePriceInclTax($_item); ?>
3231

33-
<?= /* @escapeNotVerified */ $block->displayPrices($_baseIncl, $_incl) ?>
32+
<?= /* @noEscape */ $block->displayPrices($_baseIncl, $_incl) ?>
3433

3534
</div>
3635
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<?php
1110
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
1211

1312
$_item = $block->getItem();
1413
?>
1514

16-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
17-
<?php if ($block->displayBothPrices($block->getStore())): ?>
18-
<span class="label"><?= /* @escapeNotVerified */ __('Excl. Tax') ?>:</span>
15+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
16+
<?php if ($block->displayBothPrices($block->getStore())) : ?>
17+
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1918
<?php endif; ?>
20-
<?= /* @escapeNotVerified */ $block->formatPrice($_item->getRowTotal()) ?>
19+
<?= /* @noEscape */ $block->formatPrice($_item->getRowTotal()) ?>
2120
<?php endif; ?>
2221

23-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
24-
<?php if ($block->displayBothPrices()): ?>
25-
<br /><span class="label"><?= /* @escapeNotVerified */ __('Incl. Tax') ?>:</span>
22+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
23+
<?php if ($block->displayBothPrices()) : ?>
24+
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2625
<?php endif; ?>
27-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getSubtotalInclTax($_item); ?>
28-
<?= /* @escapeNotVerified */ $block->formatPrice($_incl) ?>
26+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?>
27+
<?= /* @noEscape */ $block->formatPrice($_incl) ?>
2928
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,26 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<?php
118
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
129

1310
$_item = $block->getItem();
1411
?>
1512

16-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
13+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
1714
<?php $_rowTotalWithoutDiscount = $_item->getRowTotal() - $_item->getTotalDiscountAmount(); ?>
18-
<?php if ($block->displayBothPrices()): ?>
19-
<span class="label"><?= /* @escapeNotVerified */ __('Excl. Tax') ?>:</span>
15+
<?php if ($block->displayBothPrices()) : ?>
16+
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
2017
<?php endif; ?>
21-
<?= /* @escapeNotVerified */ $block->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?>
18+
<?= /* @noEscape */ $block->formatPrice(max(0, $_rowTotalWithoutDiscount)) ?>
2219
<?php endif; ?>
2320

2421

25-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
26-
<?php if ($block->displayBothPrices($block->getStore())): ?>
27-
<br /><span class="label"><?= /* @escapeNotVerified */ __('Incl. Tax') ?>:</span>
22+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
23+
<?php if ($block->displayBothPrices($block->getStore())) : ?>
24+
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2825
<?php endif; ?>
2926
<?php $_incl = $block->getTotalAmount($_item); ?>
30-
<?= /* @escapeNotVerified */ $block->formatPrice($_incl) ?>
27+
<?= /* @noEscape */ $block->formatPrice($_incl) ?>
3128
<?php endif; ?>

app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,26 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<?php
1110
/** @var \Magento\Tax\Block\Adminhtml\Items\Price\Renderer $block */
1211

1312
$_item = $block->getItem();
1413
?>
1514

16-
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()): ?>
17-
<?php if ($block->displayBothPrices()): ?>
18-
<span class="label"><?= /* @escapeNotVerified */ __('Excl. Tax') ?>:</span>
15+
<?php if ($block->displayPriceExclTax() || $block->displayBothPrices()) : ?>
16+
<?php if ($block->displayBothPrices()) : ?>
17+
<span class="label"><?= $block->escapeHtml(__('Excl. Tax')) ?>:</span>
1918
<?php endif; ?>
20-
<?= /* @escapeNotVerified */ $block->formatPrice($_item->getCalculationPrice()) ?>
19+
<?= /* @noEscape */ $block->formatPrice($_item->getCalculationPrice()) ?>
2120
<?php endif; ?>
2221

2322

24-
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()): ?>
25-
<?php if ($block->displayBothPrices()): ?>
26-
<br /><span class="label"><?= /* @escapeNotVerified */ __('Incl. Tax') ?>:</span>
23+
<?php if ($block->displayPriceInclTax() || $block->displayBothPrices()) : ?>
24+
<?php if ($block->displayBothPrices()) : ?>
25+
<br /><span class="label"><?= $block->escapeHtml(__('Incl. Tax')) ?>:</span>
2726
<?php endif; ?>
28-
<?php $_incl = $this->helper('Magento\Checkout\Helper\Data')->getPriceInclTax($_item); ?>
29-
<?= /* @escapeNotVerified */ $block->formatPrice($_incl) ?>
27+
<?php $_incl = $this->helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?>
28+
<?= /* @noEscape */ $block->formatPrice($_incl) ?>
3029
<?php endif; ?>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<div class="entry-edit form-inline">
118
<?= $block->getFormHtml() ?>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
7+
// phpcs:disable Magento2.Templates.ThisInTemplate
98
?>
109
<script>
1110
require([
1211
"jquery",
1312
"mage/adminhtml/form"
1413
], function(jQuery){
1514

16-
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?= /* @escapeNotVerified */ $this->helper('Magento\Directory\Helper\Data')->getRegionJson() ?>, 'disable');
15+
var updater = new RegionUpdater('tax_country_id', 'tax_region', 'tax_region_id', <?= /* @noEscape */ $this->helper(\Magento\Directory\Helper\Data::class)->getRegionJson() ?>, 'disable');
1716
updater.disableRegionValidation();
1817

1918
(function ($) {

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,29 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
96
?>
107
<fieldset id="tax-rate-titles-table" class="admin__fieldset">
118
<?php $_labels = $block->getTitles() ?>
12-
<?php foreach ($block->getStores() as $_store): ?>
9+
<?php foreach ($block->getStores() as $_store) : ?>
1310
<div class="admin__field">
14-
<label class="admin__field-label"><span><?= /* @escapeNotVerified */ $_store->getName() ?></span></label>
11+
<label class="admin__field-label">
12+
<span><?= $block->escapeHtml($_store->getName()) ?></span>
13+
</label>
1514
<div class="admin__field-control">
1615
<input
17-
class="admin__control-text<?php if ($_store->getId() == 0): ?> required-entry<?php endif; ?>"
16+
class="admin__control-text<?php if ($_store->getId() == 0) : ?> required-entry<?php endif; ?>"
1817
type="text"
19-
name="title[<?= /* @escapeNotVerified */ $_store->getId() ?>]"
20-
value="<?= /* @escapeNotVerified */ $_labels[$_store->getId()] ?>" />
18+
name="title[<?= (int) $_store->getId() ?>]"
19+
value="<?= $block->escapeHtmlAttr($_labels[(int) $_store->getId()]) ?>" />
2120
</div>
2221
</div>
2322
<?php endforeach; ?>
2423

2524
<div class="messages">
2625
<div class="message message-notice">
2726
<div>
28-
<strong><?= /* @escapeNotVerified */ __('Note:') ?></strong>
29-
<?= /* @escapeNotVerified */ __('Leave this field empty if you wish to use the tax identifier.') ?>
27+
<strong><?= $block->escapeHtml(__('Note:')) ?></strong>
28+
<?= $block->escapeHtml(__('Leave this field empty if you wish to use the tax identifier.')) ?>
3029
</div>
3130
</div>
3231
</div>

0 commit comments

Comments
 (0)