Repository navigation
Fixed Accept uppercase image extensions (.JPG/.JPEG) [2.0 ] - #513
Merged
navneetkumar-pim-webkul merged 1 commit intoJun 19, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of to the
2.0branch.Uploading a valid image whose filename has an UPPERCASE extension
(e.g.
IMG_1234.JPG,PHOTO.JPEG— common for camera/iPhone exports)was rejected with "The image field must have one of the following
extensions...", even though the file was a genuine image.
Root cause:
IMAGE_ALLOWED_EXTENSIONSis lowercase and the extensioncomparisons were case-sensitive, so
"JPG" !== "jpg".This affected two rules — the second is why a single-line fix would have
been incomplete (the error would have just moved from
validation.extensionsto
file-mime-extension-mismatch):packages/Webkul/Core/src/Rules/FileOrImageValidValue.php— lowercasethe extension in the allowed-extensions
in_array()check.packages/Webkul/Core/src/Rules/FileMimeExtensionMatch.php— lowercasethe extension in the
guessExtension()comparison.Lowercasing is applied only inside the comparisons, so:
type doesn't match its extension is still rejected.
Impacted upload paths: product image/file attributes, category image
fields, attribute-option swatches, user profile image, and TinyMCE
rich-text uploads.
The patch from #511 applied cleanly to
2.0(both files match context).How To Test This?
.jpgimage and rename the extension to uppercase.JPG..JPEGand.PNG→ accepted..jpg(lowercase) still uploads as before..JPG(mismatched realtype) → still rejected by the mime/extension check.
Checklist
vendor/bin/pestpasses locallyvendor/bin/pint --testreports no style issues2.0(unless a maintainer requested a backport)