From f49cc5ec30e9ba857bf92763bf882bdf96cb0eb9 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 3 Jan 2016 09:50:27 +0100 Subject: [PATCH] Resolve TODO in ViewableMedia::getElementTag() --- .../install/files/lib/data/media/ViewableMedia.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ''; -- 2.20.1