From a1621075518046ecbf09f950569d629f67e8a8d2 Mon Sep 17 00:00:00 2001 From: Dan Beeston Date: Tue, 15 Feb 2022 11:16:12 +1000 Subject: [PATCH] files without extensions are rejected 2 --- src/BladeImageCrop.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BladeImageCrop.php b/src/BladeImageCrop.php index e49af9a..3ac8c19 100644 --- a/src/BladeImageCrop.php +++ b/src/BladeImageCrop.php @@ -13,7 +13,7 @@ public function fire($url, $dimensions, $offset = ['x'=>50, 'y'=>50], $format = $url = trim($url, "/"); - if ($this->fileNotFound($url)){ + if ($this->fileNotImage($url)){ if (!\App::environment(['local'])) { return 'IMAGENOTFOUND'; } @@ -31,7 +31,7 @@ public function fire($url, $dimensions, $offset = ['x'=>50, 'y'=>50], $format = return $newImageUrl; } - public function fileNotFound($url){ + public function fileNotImage($url){ return !Storage::disk( config('bladeimagecrop.disk') )->has($url) || Storage::disk( config('bladeimagecrop.disk') )->getMetadata($url)['type'] != 'file' || pathinfo(Storage::disk( config('bladeimagecrop.disk') )->url($url), PATHINFO_EXTENSION) === '';