diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php index 5f4a7c8f3814b..9114b0fcaf31c 100644 --- a/app/code/Magento/Wishlist/Block/AbstractBlock.php +++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php @@ -211,7 +211,7 @@ public function getItemConfigureUrl($product) public function getEscapedDescription($item) { if ($item->getDescription()) { - return $this->escapeHtml($item->getDescription()); + return $this->_escaper->escapeHtml($item->getDescription()); } return ' '; } diff --git a/app/code/Magento/Wishlist/Block/Catalog/Product/View/AddTo/Wishlist.php b/app/code/Magento/Wishlist/Block/Catalog/Product/View/AddTo/Wishlist.php index 578d784bfd7dc..635fd7e17763f 100644 --- a/app/code/Magento/Wishlist/Block/Catalog/Product/View/AddTo/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Catalog/Product/View/AddTo/Wishlist.php @@ -33,7 +33,7 @@ public function getWishlistOptionsJson() */ public function getWishlistOptions() { - return ['productType' => $this->escapeHtml($this->getProduct()->getTypeId())]; + return ['productType' => $this->_escaper->escapeHtml($this->getProduct()->getTypeId())]; } /** diff --git a/app/code/Magento/Wishlist/Block/Customer/Sharing.php b/app/code/Magento/Wishlist/Block/Customer/Sharing.php index 40fd00d6143a5..e0e82b380092f 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Sharing.php +++ b/app/code/Magento/Wishlist/Block/Customer/Sharing.php @@ -107,7 +107,7 @@ public function getEnteredData($key) if (!$this->_enteredData || !isset($this->_enteredData[$key])) { return null; } else { - return $this->escapeHtml($this->_enteredData[$key]); + return $this->_escaper->escapeHtml($this->_enteredData[$key]); } } diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php index 82133927e1201..8e6e6d22c88ec 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -111,10 +111,10 @@ public function getConfiguredOptions() if (!(array_key_exists('has_html', $option) && $option['has_html'] === true)) { if (is_array($option['value'])) { foreach ($option['value'] as $key => $value) { - $option['value'][$key] = $this->escapeHtml($value); + $option['value'][$key] = $this->_escaper->escapeHtml($value); } } else { - $option['value'] = $this->escapeHtml($option['value'], ["a"]); + $option['value'] = $this->_escaper->escapeHtml($option['value'], ["a"]); } } $options[$index]['value'] = $option['value']; diff --git a/app/code/Magento/Wishlist/Block/Item/Configure.php b/app/code/Magento/Wishlist/Block/Item/Configure.php index 49f308c99383b..f4102aa52c2a7 100644 --- a/app/code/Magento/Wishlist/Block/Item/Configure.php +++ b/app/code/Magento/Wishlist/Block/Item/Configure.php @@ -56,7 +56,7 @@ public function __construct( */ public function getWishlistOptions() { - return ['productType' => $this->escapeHtml($this->getProduct()->getTypeId())]; + return ['productType' => $this->_escaper->escapeHtml($this->getProduct()->getTypeId())]; } /** diff --git a/app/code/Magento/Wishlist/Block/Share/Wishlist.php b/app/code/Magento/Wishlist/Block/Share/Wishlist.php index 889fb363a2070..2a34dcc94fe4a 100644 --- a/app/code/Magento/Wishlist/Block/Share/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Share/Wishlist.php @@ -83,6 +83,6 @@ public function getWishlistCustomer() */ public function getHeader() { - return __("%1's Wish List", $this->escapeHtml($this->getWishlistCustomer()->getFirstname())); + return __("%1's Wish List", $this->_escaper->escapeHtml($this->getWishlistCustomer()->getFirstname())); } } diff --git a/app/code/Magento/Wishlist/view/adminhtml/templates/customer/edit/tab/wishlist.phtml b/app/code/Magento/Wishlist/view/adminhtml/templates/customer/edit/tab/wishlist.phtml index 7ee04bf192f29..8fea055e080f1 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/templates/customer/edit/tab/wishlist.phtml +++ b/app/code/Magento/Wishlist/view/adminhtml/templates/customer/edit/tab/wishlist.phtml @@ -4,7 +4,10 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Framework\View\Element\Template $block */ +/** + * @var \Magento\Framework\View\Element\Template $block + * @var \Magento\Framework\Escaper $escaper + */ /** @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer */ ?> escapeJs($block->getJsObjectName())}.url + '?ajax=true' + urlParams; + var url = {$escaper->escapeJs($block->getJsObjectName())}.url + '?ajax=true' + urlParams; new Ajax.Updater( - {$block->escapeJs($block->getJsObjectName())}.containerId, + {$escaper->escapeJs($block->getJsObjectName())}.containerId, url, { parameters: {form_key: FORM_KEY}, - onComplete: {$block->escapeJs($block->getJsObjectName())}.initGrid - .bind({$block->escapeJs($block->getJsObjectName())}), + onComplete: {$escaper->escapeJs($block->getJsObjectName())}.initGrid + .bind({$escaper->escapeJs($block->getJsObjectName())}), evalScripts:true } ); @@ -51,7 +54,7 @@ var self = this; confirm({ - content: '{$block->escapeJs(__('Are you sure you want to remove this item?'))}', + content: '{$escaper->escapeJs(__('Are you sure you want to remove this item?'))}', actions: { confirm: function () { self.reload('&delete=' + itemId); @@ -64,8 +67,8 @@ productConfigure.addListType( 'wishlist', { - urlFetch: '{$block->escapeJs($block->getUrl('customer/wishlist_product_composite_wishlist/configure'))}', - urlConfirm: '{$block->escapeJs($block->getUrl('customer/wishlist_product_composite_wishlist/update'))}' + urlFetch: '{$escaper->escapeJs($block->getUrl('customer/wishlist_product_composite_wishlist/configure'))}', + urlConfirm: '{$escaper->escapeJs($block->getUrl('customer/wishlist_product_composite_wishlist/update'))}' } ); //--> diff --git a/app/code/Magento/Wishlist/view/base/templates/product/price/bundle/configured_price.phtml b/app/code/Magento/Wishlist/view/base/templates/product/price/bundle/configured_price.phtml index 260dd5a24396a..d07c798bbde74 100644 --- a/app/code/Magento/Wishlist/view/base/templates/product/price/bundle/configured_price.phtml +++ b/app/code/Magento/Wishlist/view/base/templates/product/price/bundle/configured_price.phtml @@ -5,7 +5,10 @@ */ ?> getZone() == 'item_view'); $idSuffix = $block->getIdSuffix() ?: ''; ?> @@ -15,8 +18,8 @@ $idSuffix = $block->getIdSuffix() ?: ''; renderAmount( $block->getConfiguredPrice()->getAmount(), [ - 'display_label' => $block->escapeHtml(__('Special Price')), - 'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml(__('Special Price')), + 'price_id' => $escaper->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), 'price_type' => 'finalPrice', 'include_container' => true, 'schema' => $schema, @@ -27,8 +30,8 @@ $idSuffix = $block->getIdSuffix() ?: ''; renderAmount( $block->getConfiguredRegularPrice()->getAmount(), [ - 'display_label' => $block->escapeHtml(__('Regular Price')), - 'price_id' => $block->escapeHtml($block->getPriceId('old-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml(__('Regular Price')), + 'price_id' => $escaper->escapeHtml($block->getPriceId('old-price-' . $idSuffix)), 'price_type' => 'oldPrice', 'include_container' => true, 'skip_adjustments' => true, @@ -46,8 +49,8 @@ $idSuffix = $block->getIdSuffix() ?: ''; renderAmount( $block->getConfiguredPrice()->getAmount(), [ - 'display_label' => $block->escapeHtml($priceLabel), - 'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml($priceLabel), + 'price_id' => $escaper->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), 'price_type' => 'finalPrice', 'include_container' => true, 'schema' => $schema, diff --git a/app/code/Magento/Wishlist/view/base/templates/product/price/configurable/configured_price.phtml b/app/code/Magento/Wishlist/view/base/templates/product/price/configurable/configured_price.phtml index f9517a106a79a..07d4c2bc230e6 100644 --- a/app/code/Magento/Wishlist/view/base/templates/product/price/configurable/configured_price.phtml +++ b/app/code/Magento/Wishlist/view/base/templates/product/price/configurable/configured_price.phtml @@ -5,7 +5,10 @@ */ ?> getZone() == 'item_view'); $idSuffix = $block->getIdSuffix() ?: ''; /** @var \Magento\Wishlist\Pricing\ConfiguredPrice\ConfigurableProduct $configuredPrice */ @@ -20,8 +23,8 @@ $configuredRegularAmountValue = $configuredPrice->getConfiguredRegularAmount()-> renderAmount( $configuredPrice->getConfiguredAmount(), [ - 'display_label' => $block->escapeHtml(__('Special Price')), - 'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml(__('Special Price')), + 'price_id' => $escaper->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), 'price_type' => 'finalPrice', 'include_container' => true, 'schema' => $schema, @@ -32,8 +35,8 @@ $configuredRegularAmountValue = $configuredPrice->getConfiguredRegularAmount()-> renderAmount( $configuredPrice->getConfiguredRegularAmount(), [ - 'display_label' => $block->escapeHtml(__('Regular Price')), - 'price_id' => $block->escapeHtml($block->getPriceId('old-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml(__('Regular Price')), + 'price_id' => $escaper->escapeHtml($block->getPriceId('old-price-' . $idSuffix)), 'price_type' => 'oldPrice', 'include_container' => true, 'skip_adjustments' => true, @@ -51,8 +54,8 @@ $configuredRegularAmountValue = $configuredPrice->getConfiguredRegularAmount()-> renderAmount( $configuredPrice->getAmount(), [ - 'display_label' => $block->escapeHtml($priceLabel), - 'price_id' => $block->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), + 'display_label' => $escaper->escapeHtml($priceLabel), + 'price_id' => $escaper->escapeHtml($block->getPriceId('product-price-' . $idSuffix)), 'price_type' => 'finalPrice', 'include_container' => true, 'schema' => $schema, diff --git a/app/code/Magento/Wishlist/view/frontend/templates/button/share.phtml b/app/code/Magento/Wishlist/view/frontend/templates/button/share.phtml index 0ec1febaf2f7f..4eb0880e3b929 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/button/share.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/button/share.phtml @@ -4,10 +4,13 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block */ +/** + * @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block + * @var \Magento\Framework\Escaper $escaper + */ ?> getWishlist()->getItemsCount() && $block->getWishlist()->getShared() < $block->getConfig()->getSharingEmailLimit()) : ?> - diff --git a/app/code/Magento/Wishlist/view/frontend/templates/button/tocart.phtml b/app/code/Magento/Wishlist/view/frontend/templates/button/tocart.phtml index 30d6c85ab64cd..c0a3b1ff3026a 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/button/tocart.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/button/tocart.phtml @@ -4,11 +4,14 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block */ +/** + * @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block + * @var \Magento\Framework\Escaper $escaper + */ ?> getWishlist()->getItemsCount() && $block->getWishlist()->isSalable()) : ?> - diff --git a/app/code/Magento/Wishlist/view/frontend/templates/button/update.phtml b/app/code/Magento/Wishlist/view/frontend/templates/button/update.phtml index 6d8e13eeca5fd..c6ee61125741a 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/button/update.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/button/update.phtml @@ -4,11 +4,14 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block */ +/** + * @var \Magento\Wishlist\Block\Customer\Wishlist\Button $block + * @var \Magento\Framework\Escaper $escaper + */ ?> getWishlist()->getItemsCount()) : ?> - diff --git a/app/code/Magento/Wishlist/view/frontend/templates/cart/item/renderer/actions/move_to_wishlist.phtml b/app/code/Magento/Wishlist/view/frontend/templates/cart/item/renderer/actions/move_to_wishlist.phtml index 99732791e108b..373070ef77cae 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/cart/item/renderer/actions/move_to_wishlist.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/cart/item/renderer/actions/move_to_wishlist.phtml @@ -4,12 +4,15 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Wishlist\Block\Cart\Item\Renderer\Actions\MoveToWishlist $block */ +/** + * @var \Magento\Wishlist\Block\Cart\Item\Renderer\Actions\MoveToWishlist $block + * @var \Magento\Framework\Escaper $escaper + */ ?> isAllowInCart() && $block->isProductVisibleInSiteVisibility()) : ?> - escapeHtml(__('Move to Wishlist')) ?> + escapeHtml(__('Move to Wishlist')) ?> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/list/addto/wishlist.phtml b/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/list/addto/wishlist.phtml index 2427f883c2b53..40a51986ef494 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/list/addto/wishlist.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/list/addto/wishlist.phtml @@ -4,16 +4,19 @@ * See COPYING.txt for license details. */ -/** @var Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist $block */ +/** + * @var Magento\Wishlist\Block\Catalog\Product\ProductList\Item\AddTo\Wishlist $block + * @var \Magento\Framework\Escaper $escaper + */ ?> getWishlistHelper()->isAllow()) : ?> - escapeHtml(__('Add to Wish List')) ?> + escapeHtml(__('Add to Wish List')) ?> diff --git a/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml b/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml index a0c680ea24e32..6b0cc9a3dd6d7 100644 --- a/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml +++ b/app/code/Magento/Wishlist/view/frontend/templates/catalog/product/view/addto/wishlist.phtml @@ -4,13 +4,16 @@ * See COPYING.txt for license details. */ -/** @var \Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist $block */ +/** + * @var \Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist $block + * @var \Magento\Framework\Escaper $escaper + */ ?> isWishListAllowed()) : ?> escapeHtml(__('Add to Wish List')) ?> + data-action="add-to-wishlist">escapeHtml(__('Add to Wish List')) ?>