@@ -13,14 +13,16 @@ use Magento\Framework\App\Action\Action;
1313 * Product list template
1414 *
1515 * @var $block \Magento\Catalog\Block\Product\ListProduct
16+ * @var \Magento\Framework\Escaper $escaper
1617 */
1718?>
1819<?php
1920$ _productCollection = $ block ->getLoadedProductCollection ();
21+ /** @var \Magento\Catalog\Helper\Output $_helper */
2022$ _helper = $ this ->helper (Magento \Catalog \Helper \Output::class);
2123?>
2224<?php if (!$ _productCollection ->count ()) :?>
23- <div class="message info empty"><div><?= $ block ->escapeHtml (__ ('We can \'t find products matching the selection. ' )) ?> </div></div>
25+ <div class="message info empty"><div><?= $ escaper ->escapeHtml (__ ('We can \'t find products matching the selection. ' )) ?> </div></div>
2426<?php else :?>
2527 <?= $ block ->getToolbarHtml () ?>
2628 <?= $ block ->getAdditionalHtml () ?>
@@ -55,7 +57,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
5557 }
5658 ?>
5759 <?php // Product Image ?>
58- <a href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> "
60+ <a href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> "
5961 class="product photo product-item-photo"
6062 tabindex="-1">
6163 <?= $ productImage ->toHtml () ?>
@@ -66,7 +68,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
6668 ?>
6769 <strong class="product name product-item-name">
6870 <a class="product-item-link"
69- href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> ">
71+ href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> ">
7072 <?= /* @noEscape */ $ _helper ->productAttribute ($ _product , $ _product ->getName (), 'name ' ) ?>
7173 </a>
7274 </strong>
@@ -77,13 +79,13 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
7779 <?php endif ; ?>
7880
7981 <div class="product-item-inner">
80- <div class="product actions product-item-actions"<?= strpos ($ pos , $ viewMode . '-actions ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
81- <div class="actions-primary"<?= strpos ($ pos , $ viewMode . '-primary ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
82+ <div class="product actions product-item-actions"<?= strpos ($ pos , $ viewMode . '-actions ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
83+ <div class="actions-primary"<?= strpos ($ pos , $ viewMode . '-primary ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
8284 <?php if ($ _product ->isSaleable ()) :?>
8385 <?php $ postParams = $ block ->getAddToCartPostParams ($ _product ); ?>
8486 <form data-role="tocart-form"
85- data-product-sku="<?= $ block ->escapeHtml ($ _product ->getSku ()) ?> "
86- action="<?= $ block ->escapeUrl ($ postParams ['action ' ]) ?> "
87+ data-product-sku="<?= $ escaper ->escapeHtml ($ _product ->getSku ()) ?> "
88+ action="<?= $ escaper ->escapeUrl ($ postParams ['action ' ]) ?> "
8789 method="post">
8890 <input type="hidden"
8991 name="product"
@@ -92,20 +94,20 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
9294 value="<?= /* @noEscape */ $ postParams ['data ' ][Action::PARAM_NAME_URL_ENCODED ] ?> ">
9395 <?= $ block ->getBlockHtml ('formkey ' ) ?>
9496 <button type="submit"
95- title="<?= $ block ->escapeHtmlAttr (__ ('Add to Cart ' )) ?> "
97+ title="<?= $ escaper ->escapeHtmlAttr (__ ('Add to Cart ' )) ?> "
9698 class="action tocart primary">
97- <span><?= $ block ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
99+ <span><?= $ escaper ->escapeHtml (__ ('Add to Cart ' )) ?> </span>
98100 </button>
99101 </form>
100102 <?php else :?>
101103 <?php if ($ _product ->isAvailable ()) :?>
102- <div class="stock available"><span><?= $ block ->escapeHtml (__ ('In stock ' )) ?> </span></div>
104+ <div class="stock available"><span><?= $ escaper ->escapeHtml (__ ('In stock ' )) ?> </span></div>
103105 <?php else :?>
104- <div class="stock unavailable"><span><?= $ block ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
106+ <div class="stock unavailable"><span><?= $ escaper ->escapeHtml (__ ('Out of stock ' )) ?> </span></div>
105107 <?php endif ; ?>
106108 <?php endif ; ?>
107109 </div>
108- <div data-role="add-to-links" class="actions-secondary"<?= strpos ($ pos , $ viewMode . '-secondary ' ) ? $ block ->escapeHtmlAttr ($ position ) : '' ?> >
110+ <div data-role="add-to-links" class="actions-secondary"<?= strpos ($ pos , $ viewMode . '-secondary ' ) ? $ escaper ->escapeHtmlAttr ($ position ) : '' ?> >
109111 <?php if ($ addToBlock = $ block ->getChildBlock ('addto ' )) :?>
110112 <?= $ addToBlock ->setProduct ($ _product )->getChildHtml () ?>
111113 <?php endif ; ?>
@@ -114,9 +116,9 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
114116 <?php if ($ showDescription ) :?>
115117 <div class="product description product-item-description">
116118 <?= /* @noEscape */ $ _helper ->productAttribute ($ _product , $ _product ->getShortDescription (), 'short_description ' ) ?>
117- <a href="<?= $ block ->escapeUrl ($ _product ->getProductUrl ()) ?> "
119+ <a href="<?= $ escaper ->escapeUrl ($ _product ->getProductUrl ()) ?> "
118120 title="<?= /* @noEscape */ $ _productNameStripped ?> "
119- class="action more"><?= $ block ->escapeHtml (__ ('Learn More ' )) ?> </a>
121+ class="action more"><?= $ escaper ->escapeHtml (__ ('Learn More ' )) ?> </a>
120122 </div>
121123 <?php endif ; ?>
122124 </div>
@@ -132,7 +134,7 @@ $_helper = $this->helper(Magento\Catalog\Helper\Output::class);
132134 {
133135 "[data-role=tocart-form], .form.map.checkout": {
134136 "catalogAddToCart": {
135- "product_sku": "<?= $ block ->escapeJs ($ _product ->getSku ()) ?> "
137+ "product_sku": "<?= $ escaper ->escapeJs ($ _product ->getSku ()) ?> "
136138 }
137139 }
138140 }
0 commit comments