From 9b0ef85f77f140be8dffa2f333070f0429c15bb2 Mon Sep 17 00:00:00 2001 From: DanielGordonIT <108084596+DanielGordonIT@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:50:25 -0400 Subject: [PATCH] Wraps file extension comparison components in strtolower() This avoids the issue where replacing file.PNG with newfile.png fails due to "PNG" not being equal to "png" --- app/Uploads/ImageRepo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Uploads/ImageRepo.php b/app/Uploads/ImageRepo.php index 1e58816a4..845067fdc 100644 --- a/app/Uploads/ImageRepo.php +++ b/app/Uploads/ImageRepo.php @@ -166,7 +166,7 @@ class ImageRepo */ public function updateImageFile(Image $image, UploadedFile $file): void { - if ($file->getClientOriginalExtension() !== pathinfo($image->path, PATHINFO_EXTENSION)) { + if (strtolower($file->getClientOriginalExtension()) !== strtolower(pathinfo($image->path, PATHINFO_EXTENSION))) { throw new ImageUploadException(trans('errors.image_upload_replace_type')); }