From 5dd61d9f56c89ea8a2be8c02ab648d3d9b5b6091 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 16 Jan 2022 15:18:03 +0100 Subject: [PATCH] Enable lazy loading of media thumbnails --- .../install/files/lib/data/media/ViewableMedia.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php index 40bb353fd1..3b12914abc 100644 --- a/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php +++ b/wcfsetup/install/files/lib/data/media/ViewableMedia.class.php @@ -209,7 +209,14 @@ class ViewableMedia extends DatabaseObjectDecorator throw new \InvalidArgumentException("Unknown thumbnail size '" . $size . "'"); } - return '' . StringUtil::encodeHTML($this->altText) . 'title ? 'title="' . StringUtil::encodeHTML($this->title) . '" ' : '') . 'style="width: ' . $this->getThumbnailWidth($size) . 'px; height: ' . $this->getThumbnailHeight($size) . 'px;">'; + return \sprintf( + '%s', + StringUtil::encodeHTML($this->getThumbnailLink($size)), + StringUtil::encodeHTML($this->altText), + $this->getThumbnailWidth($size), + $this->getThumbnailHeight($size), + ($this->title ? 'title="' . StringUtil::encodeHTML($this->title) . '" ' : '') + ); } /** -- 2.20.1