diff --git a/app/code/Magento/Tax/Block/Checkout/Shipping.php b/app/code/Magento/Tax/Block/Checkout/Shipping.php index 45c6e42574770..760466584a429 100644 --- a/app/code/Magento/Tax/Block/Checkout/Shipping.php +++ b/app/code/Magento/Tax/Block/Checkout/Shipping.php @@ -96,7 +96,7 @@ public function getIncludeTaxLabel() { return __( 'Shipping Incl. Tax (%1)', - $this->escapeHtml($this->getQuote()->getShippingAddress()->getShippingDescription()) + $this->_escaper->escapeHtml($this->getQuote()->getShippingAddress()->getShippingDescription()) ); } @@ -109,7 +109,7 @@ public function getExcludeTaxLabel() { return __( 'Shipping Excl. Tax (%1)', - $this->escapeHtml($this->getQuote()->getShippingAddress()->getShippingDescription()) + $this->_escaper->escapeHtml($this->getQuote()->getShippingAddress()->getShippingDescription()) ); } diff --git a/app/code/Magento/Tax/Block/Grid/Renderer/Codes.php b/app/code/Magento/Tax/Block/Grid/Renderer/Codes.php index 6c4e754f7e316..7197c62cf682c 100644 --- a/app/code/Magento/Tax/Block/Grid/Renderer/Codes.php +++ b/app/code/Magento/Tax/Block/Grid/Renderer/Codes.php @@ -20,6 +20,6 @@ public function render(\Magento\Framework\DataObject $row) { $ratesCodes = $row->getTaxRatesCodes(); - return $ratesCodes && is_array($ratesCodes) ? $this->escapeHtml(implode(', ', $ratesCodes)) : ''; + return $ratesCodes && is_array($ratesCodes) ? $this->_escaper->escapeHtml(implode(', ', $ratesCodes)) : ''; } } diff --git a/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml b/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml index 4d680dc072e52..6e13d7a8b6a36 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/items/price/row.phtml @@ -7,14 +7,17 @@ // phpcs:disable Magento2.Templates.ThisInTemplate ?> getItem(); ?> displayBothPrices() || $block->displayPriceExclTax()) : ?>
displayBothPrices()) : ?> - escapeHtml(__('Excl. Tax')) ?>: + escapeHtml(__('Excl. Tax')) ?>: displayPrices($_item->getBaseRowTotal(), $_item->getRowTotal()) ?>
@@ -22,7 +25,7 @@ $_item = $block->getItem(); displayBothPrices() || $block->displayPriceInclTax()) : ?>
displayBothPrices()) : ?> - escapeHtml(__('Incl. Tax')) ?>: + escapeHtml(__('Incl. Tax')) ?>: helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?> helper(\Magento\Checkout\Helper\Data::class)->getBaseSubtotalInclTax($_item); ?> diff --git a/app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml index 817a6264e5eae..a43a563761951 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/items/price/unit.phtml @@ -7,7 +7,10 @@ // phpcs:disable Magento2.Templates.ThisInTemplate ?> getItem(); ?> @@ -15,7 +18,7 @@ $_item = $block->getItem(); helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceExclTax()) : ?>
helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?> - escapeHtml(__('Excl. Tax')) ?>: + escapeHtml(__('Excl. Tax')) ?>: displayPrices($_item->getBasePrice(), $_item->getPrice()) ?> @@ -24,7 +27,7 @@ $_item = $block->getItem(); helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices() || $this->helper(\Magento\Tax\Helper\Data::class)->displaySalesPriceInclTax()) : ?>
helper(\Magento\Tax\Helper\Data::class)->displaySalesBothPrices()) : ?> - escapeHtml(__('Incl. Tax')) ?>: + escapeHtml(__('Incl. Tax')) ?>: helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?> helper(\Magento\Checkout\Helper\Data::class)->getBasePriceInclTax($_item); ?> diff --git a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml index eeaf769542033..c77bfb7b5dbd2 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/row.phtml @@ -7,21 +7,24 @@ // phpcs:disable Magento2.Templates.ThisInTemplate ?> getItem(); ?> displayPriceExclTax() || $block->displayBothPrices()) : ?> displayBothPrices($block->getStore())) : ?> - escapeHtml(__('Excl. Tax')) ?>: + escapeHtml(__('Excl. Tax')) ?>: formatPrice($_item->getRowTotal()) ?> displayPriceInclTax() || $block->displayBothPrices()) : ?> displayBothPrices()) : ?> -
escapeHtml(__('Incl. Tax')) ?>: +
escapeHtml(__('Incl. Tax')) ?>: helper(\Magento\Checkout\Helper\Data::class)->getSubtotalInclTax($_item); ?> formatPrice($_incl) ?> diff --git a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml index 462a1a65f97c3..ec5329916438e 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/total.phtml @@ -5,7 +5,10 @@ */ ?> getItem(); ?> @@ -13,7 +16,7 @@ $_item = $block->getItem(); displayPriceExclTax() || $block->displayBothPrices()) : ?> getRowTotal() - $_item->getTotalDiscountAmount(); ?> displayBothPrices()) : ?> - escapeHtml(__('Excl. Tax')) ?>: + escapeHtml(__('Excl. Tax')) ?>: formatPrice(max(0, $_rowTotalWithoutDiscount)) ?> @@ -21,7 +24,7 @@ $_item = $block->getItem(); displayPriceInclTax() || $block->displayBothPrices()) : ?> displayBothPrices($block->getStore())) : ?> -
escapeHtml(__('Incl. Tax')) ?>: +
escapeHtml(__('Incl. Tax')) ?>: getTotalAmount($_item); ?> formatPrice($_incl) ?> diff --git a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml index 066b6a04fded4..467a06e923039 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/order/create/items/price/unit.phtml @@ -7,14 +7,17 @@ // phpcs:disable Magento2.Templates.ThisInTemplate ?> getItem(); ?> displayPriceExclTax() || $block->displayBothPrices()) : ?> displayBothPrices()) : ?> - escapeHtml(__('Excl. Tax')) ?>: + escapeHtml(__('Excl. Tax')) ?>: formatPrice($_item->getCalculationPrice()) ?> @@ -22,7 +25,7 @@ $_item = $block->getItem(); displayPriceInclTax() || $block->displayBothPrices()) : ?> displayBothPrices()) : ?> -
escapeHtml(__('Incl. Tax')) ?>: +
escapeHtml(__('Incl. Tax')) ?>: helper(\Magento\Checkout\Helper\Data::class)->getPriceInclTax($_item); ?> formatPrice($_incl) ?> diff --git a/app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml b/app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml index 7dd6f6cee8c63..c103fa7739a74 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/rate/title.phtml @@ -3,20 +3,24 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +/** + * @var \Magento\Framework\Escaper $escaper + */ ?>
getTitles() ?> getStores() as $_store) : ?>
+ value="escapeHtmlAttr($_labels[(int) $_store->getId()]) ?>" />
@@ -24,8 +28,8 @@
- escapeHtml(__('Note:')) ?> - escapeHtml(__('Leave this field empty if you wish to use the tax identifier.')) ?> + escapeHtml(__('Note:')) ?> + escapeHtml(__('Leave this field empty if you wish to use the tax identifier.')) ?>
diff --git a/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml b/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml index 0141101ef5a78..da564e90ee628 100644 --- a/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml +++ b/app/code/Magento/Tax/view/adminhtml/templates/rule/edit.phtml @@ -4,7 +4,10 @@ * See COPYING.txt for license details. */ -/** @var $block \Magento\Tax\Block\Adminhtml\Rule\Edit\Form */ +/** + * @var $block \Magento\Tax\Block\Adminhtml\Rule\Edit\Form + * @var \Magento\Framework\Escaper $escaper + */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> escapeJs($block->getTaxRateLoadUrl())}', + url: '{$escaper->escapeJs($block->getTaxRateLoadUrl())}', success: function(result, status) { $('body').trigger('processStop'); if (result.success) { @@ -98,14 +101,14 @@ require([ }); else alert({ - content: '{$block->escapeJs(__('An error occurred'))}' + content: '{$escaper->escapeJs(__('An error occurred'))}' }); } }, error: function () { $('body').trigger('processStop'); alert({ - content: '{$block->escapeJs(__('An error occurred'))}' + content: '{$escaper->escapeJs(__('An error occurred'))}' }); }, dataType: "json" @@ -116,9 +119,9 @@ require([ var options = { mselectContainer: '#tax_rate + section.mselect-list', toggleAddButton:false, - addText: '{$block->escapeJs(__('Add New Tax Rate'))}', + addText: '{$escaper->escapeJs(__('Add New Tax Rate'))}', parse: null, - nextPageUrl: '{$block->escapeJs($block->getTaxRatesPageUrl())}', + nextPageUrl: '{$escaper->escapeJs($block->getTaxRatesPageUrl())}', selectedValues: this.settings.selected_values, mselectInputSubmitCallback: function (value, options) { var select = $('#tax_rate'); @@ -175,7 +178,7 @@ script; rateValue = that.parent().find('input[type="checkbox"]').val(); confirm({ - content: '{$block->escapeJs(__('Do you really want to delete this tax rate?'))}', + content: '{$escaper->escapeJs(__('Do you really want to delete this tax rate?'))}', actions: { /** * Confirm action. @@ -189,7 +192,7 @@ script; form_key: $('input[name="form_key"]').val() }, dataType: 'json', - url: '{$block->escapeJs($block->getTaxRateDeleteUrl())}', + url: '{$escaper->escapeJs($block->getTaxRateDeleteUrl())}', success: function(result, status) { $('body').trigger('processStop'); if (result.success) { @@ -207,14 +210,14 @@ script; }); else alert({ - content: '{$block->escapeJs(__('An error occurred'))}' + content: '{$escaper->escapeJs(__('An error occurred'))}' }); } }, error: function () { $('body').trigger('processStop'); alert({ - content: '{$block->escapeJs(__('An error occurred'))}' + content: '{$escaper->escapeJs(__('An error occurred'))}' }); } }; @@ -237,7 +240,7 @@ script; taxRateFormElement.mage('form').mage('validation'); taxRateForm.dialogRates({ - title: '{$block->escapeJs(__('Tax Rate'))}', + title: '{$escaper->escapeJs(__('Tax Rate'))}', type: 'slide', id: '{$jsId}', modalClass: 'tax-rate-popup', @@ -245,7 +248,7 @@ script; taxRateFormElement.data('validation').clearError(); }, buttons: [{ - text: '{$block->escapeJs(__('Save'))}', + text: '{$escaper->escapeJs(__('Save'))}', 'class': 'action-save action-primary', click: function() { this.updateItemRate(); @@ -270,7 +273,7 @@ $scriptString.= <<