throw new \InvalidArgumentException("Unknown thumbnail size '" . $size . "'");
}
- return '<img src="' . StringUtil::encodeHTML($this->getThumbnailLink($size)) . '" alt="' . StringUtil::encodeHTML($this->altText) . '" ' . ($this->title ? 'title="' . StringUtil::encodeHTML($this->title) . '" ' : '') . 'style="width: ' . $this->getThumbnailWidth($size) . 'px; height: ' . $this->getThumbnailHeight($size) . 'px;">';
+ return \sprintf(
+ '<img src="%s" alt="%s" width="%d" height="%d" loading="lazy" %s>',
+ StringUtil::encodeHTML($this->getThumbnailLink($size)),
+ StringUtil::encodeHTML($this->altText),
+ $this->getThumbnailWidth($size),
+ $this->getThumbnailHeight($size),
+ ($this->title ? 'title="' . StringUtil::encodeHTML($this->title) . '" ' : '')
+ );
}
/**