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.

CommentFileSizeAuthor
filefield_extension_case.patch924 bytesjoshk
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

i haven't tested it but that's exactly what i'd have done to fix it.

jpetso’s picture

Status: Needs review » Reviewed & tested by the community

Wonderful, 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.

jpetso’s picture

Fixed 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.

jpetso’s picture

Status: Reviewed & tested by the community » Fixed

Argh! Status update.

Anonymous’s picture

Status: Fixed » Closed (fixed)