Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently if you are allowing jpg as an extension, validation will fail if someone attempts to attach foo.JPG.
Patch fixes this by making the comparison in validation run through strtolower.
Comment | File | Size | Author |
---|---|---|---|
filefield_extension_case.patch | 924 bytes | joshk |
Comments
Comment #1
drewish CreditAttribution: drewish commentedi haven't tested it but that's exactly what i'd have done to fix it.
Comment #2
jpetso CreditAttribution: jpetso commentedWonderful, that's exactly what I wanted to come up with anyways, very useful bugfix and straightforward code-wise. You bet that I'll apply this at once when I get back to filefield (two weeks or so, I guess). The only thing with improvement potential would have been to attach this patch to the already existing bug, but hey, that's what issue queue maintainers like me are there for.
Just in case you're in the mood for doing further file validation goodness, I invite you to take a look at bug 155402 which also needs to be fixed before releasing the 5-2 version.
Comment #3
jpetso CreditAttribution: jpetso commentedFixed in commit #74242. I didn't apply your patch verbatim as more validation stuff had to be rewritten in order to also fix issue #155402, but I used the same principle of applying strtolower() to both extensions. Thanks for the patch, this issue is now fixed one and for all in filefield HEAD.
Comment #4
jpetso CreditAttribution: jpetso commentedArgh! Status update.
Comment #5
(not verified) CreditAttribution: commented