]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageService.php
Added webhook_call_before theme event hook
[bookstack] / app / Uploads / ImageService.php
index 6d4902589c5e9eb46d0a936d9cc20c205b03b1f4..b8477eb4034df5ef3f2d1eef1a10b571bb613ccb 100644 (file)
@@ -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