Fix the test for missing thumbnails
authorAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2024 13:13:06 +0000 (15:13 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 14 Aug 2024 13:13:06 +0000 (15:13 +0200)
wcfsetup/install/files/lib/data/file/thumbnail/FileThumbnail.class.php

index 6158ce450317af04c4167a4f5a17761da46f01f3..f555c56f2a8b977795805a264cf2385a92533a7b 100644 (file)
@@ -6,7 +6,6 @@ use wcf\data\DatabaseObject;
 use wcf\data\ILinkableObject;
 use wcf\system\application\ApplicationHandler;
 use wcf\system\file\processor\ThumbnailFormat;
-use wcf\system\request\LinkHandler;
 
 /**
  * @author Alexander Ebert
@@ -61,6 +60,10 @@ class FileThumbnail extends DatabaseObject implements ILinkableObject
             return true;
         }
 
+        if (!\is_readable($this->getPath() . $this->getSourceFilename())) {
+            return true;
+        }
+
         $fileHash = \hash_file('sha256', $this->getPath() . $this->getSourceFilename());
         if ($this->fileHash !== $fileHash) {
             return true;