Skip to content

Commit b90aa9e

Browse files
committed
MC-38914: Image custom attributes are incorrectly escaped
1 parent f472536 commit b90aa9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!--deprecated template as image_with_borders is a primary one-->
1212
<img class="photo image <?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
1313
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
14-
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtmlAttr($value) ?>"
14+
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
1515
<?php endforeach; ?>
1616
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
1717
loading="lazy"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $paddingBottom = $block->getRatio() * 100;
1515
<span class="product-image-wrapper">
1616
<img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
1717
<?php foreach ($block->getCustomAttributes() as $name => $value): ?>
18-
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtmlAttr($value) ?>"
18+
<?= $escaper->escapeHtmlAttr($name) ?>="<?= $escaper->escapeHtml($value) ?>"
1919
<?php endforeach; ?>
2020
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
2121
loading="lazy"

0 commit comments

Comments
 (0)