This plays more nicely with a hypothetical future content security policy and
is more consistent with other places.
$result = '<img src="' . StringUtil::encodeHTML(LinkHandler::getInstance()->getLink(
'Attachment',
$linkParameters
- )) . '"' . ($imageClasses ? ' class="' . $imageClasses . '"' : '') . ' style="width: ' . ($attachment->hasThumbnail() ? $attachment->thumbnailWidth : $attachment->width) . 'px; height: ' . ($attachment->hasThumbnail() ? $attachment->thumbnailHeight : $attachment->height) . 'px;" alt="">';
+ )) . '"' . ($imageClasses ? ' class="' . $imageClasses . '"' : '') . ' width="' . ($attachment->hasThumbnail() ? $attachment->thumbnailWidth : $attachment->width) . '" height="' . ($attachment->hasThumbnail() ? $attachment->thumbnailHeight : $attachment->height) . '" alt="">';
}
if (!$hasParentLink && $attachment->hasThumbnail() && $attachment->canDownload()) {
$result = '<a href="' . StringUtil::encodeHTML(LinkHandler::getInstance()->getLink(