1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Done a round of phpstan fixes

This commit is contained in:
Dan Brown
2021-11-06 00:32:01 +00:00
parent 5c6a6b50a0
commit 8d7c8ac8bf
24 changed files with 72 additions and 84 deletions

View 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