X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/bc291bee783a3124aa9c123de59b3acd4719b106..refs/pull/3113/head:/app/Uploads/ImageService.php diff --git a/app/Uploads/ImageService.php b/app/Uploads/ImageService.php index 6d4902589..b8477eb40 100644 --- a/app/Uploads/ImageService.php +++ b/app/Uploads/ImageService.php @@ -8,6 +8,7 @@ use Exception; use Illuminate\Contracts\Cache\Repository as Cache; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Contracts\Filesystem\Filesystem as Storage; +use Illuminate\Filesystem\FilesystemAdapter; use Illuminate\Filesystem\FilesystemManager; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; @@ -436,10 +437,12 @@ class ImageService */ public function pathExistsInLocalSecure(string $imagePath): bool { + /** @var FilesystemAdapter $disk */ $disk = $this->getStorageDisk('gallery'); // Check local_secure is active return $this->usingSecureImages() + && $disk instanceof FilesystemAdapter // Check the image file exists && $disk->exists($imagePath) // Check the file is likely an image file