Skip to content

Commit c00cef4

Browse files
author
Timon de Groot
committed
Fix deprecated method usage
1 parent e6e6725 commit c00cef4

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/image_with_borders.phtml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?>
7+
<?php
8+
/** @var $block \Magento\Catalog\Block\Product\Image */
9+
/** @var $escaper \Magento\Framework\Escaper */
10+
?>
811

912
<span class="product-image-container"
10-
style="width:<?= $block->escapeHtmlAttr($block->getWidth()) ?>px;">
13+
style="width:<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>px;">
1114
<span class="product-image-wrapper"
1215
style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
13-
<img class="<?= $block->escapeHtmlAttr($block->getClass()) ?>"
14-
<?= $block->escapeHtmlAttr($block->getCustomAttributes()) ?>
15-
src="<?= $block->escapeUrl($block->getImageUrl()) ?>"
16-
max-width="<?= $block->escapeHtmlAttr($block->getWidth()) ?>"
17-
max-height="<?= $block->escapeHtmlAttr($block->getHeight()) ?>"
18-
alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
16+
<img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
17+
<?= $escaper->escapeHtmlAttr($block->getCustomAttributes()) ?>
18+
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
19+
max-width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
20+
max-height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
21+
alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
1922
</span>

0 commit comments

Comments
 (0)