Skip to content

Commit

Permalink
Add escaping to alt tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Timon de Groot committed Feb 28, 2020
1 parent 56fde6c commit 463c460
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
?>

<img class="photo image <?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
<?= $escaper->escapeHtml($block->getCustomAttributes()) ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>" />
<?= $escaper->escapeHtml($block->getCustomAttributes()) ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
<span class="product-image-wrapper"
style="padding-bottom: <?= ($block->getRatio() * 100) ?>%;">
<img class="<?= $escaper->escapeHtmlAttr($block->getClass()) ?>"
<?= $escaper->escapeHtmlAttr($block->getCustomAttributes()) ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= /* @noEscape */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
<?= $escaper->escapeHtmlAttr($block->getCustomAttributes()) ?>
src="<?= $escaper->escapeUrl($block->getImageUrl()) ?>"
loading="lazy"
width="<?= $escaper->escapeHtmlAttr($block->getWidth()) ?>"
height="<?= $escaper->escapeHtmlAttr($block->getHeight()) ?>"
alt="<?= $escaper->escapeHtmlAttr($block->getLabel()) ?>"/></span>
</span>

0 comments on commit 463c460

Please sign in to comment.