From: Matthias Schmidt Date: Sun, 3 Jan 2016 08:50:27 +0000 (+0100) Subject: Resolve TODO in ViewableMedia::getElementTag() X-Git-Tag: 3.0.0_Beta_1~2030^2~181 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f49cc5ec30e9ba857bf92763bf882bdf96cb0eb9;p=GitHub%2FWoltLab%2FWCF.git Resolve TODO in ViewableMedia::getElementTag() --- diff --git a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php index a0e9750701..5e82edccb5 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php @@ -42,9 +42,11 @@ class ViewableMedia extends DatabaseObjectDecorator { * @return string */ public function getElementTag($size) { - // todo: validate $size if ($this->isImage && $this->tinyThumbnailType) { - return ''.StringUtil::encodeHTML($this->altText).''; + $tinyThumbnail = Media::getThumbnailSizes()['tiny']; + if ($size <= $tinyThumbnail['width'] && $size <= $tinyThumbnail['height']) { + return '' . StringUtil::encodeHTML($this->altText) . ''; + } } return '';