From ce47c0248fb5a208495017893c42a7ed02be4f8e Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Mon, 7 Sep 2020 15:23:00 -0600 Subject: [PATCH] Fix issue displaying protected file thumbnails when width or height is empty. Related #5267 --- modules/system/models/File.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/system/models/File.php b/modules/system/models/File.php index a373cb363..980da0312 100644 --- a/modules/system/models/File.php +++ b/modules/system/models/File.php @@ -26,6 +26,9 @@ class File extends FileBase public function getThumb($width, $height, $options = []) { $url = ''; + $width = !empty($width) ? $width : 0; + $height = !empty($height) ? $height : 0; + if (!$this->isPublic() && class_exists(Files::class)) { $options = $this->getDefaultThumbOptions($options); // Ensure that the thumb exists first