Skip to content

Commit 9b0ef85

Browse files
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"
1 parent 14837e3 commit 9b0ef85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/Uploads/ImageRepo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function updateImageDetails(Image $image, $updateDetails): Image
166166
*/
167167
public function updateImageFile(Image $image, UploadedFile $file): void
168168
{
169-
if ($file->getClientOriginalExtension() !== pathinfo($image->path, PATHINFO_EXTENSION)) {
169+
if (strtolower($file->getClientOriginalExtension()) !== strtolower(pathinfo($image->path, PATHINFO_EXTENSION))) {
170170
throw new ImageUploadException(trans('errors.image_upload_replace_type'));
171171
}
172172

0 commit comments

Comments
 (0)