use strtolower for $ext with icons
aaron - April 29, 2008 - 19:14
| Project: | FileField |
| Version: | 5.x-2.3-rc3 |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
use strtolower when checking $ext for icons, so that file.MP3 will match.
<?php
- $ext = array_pop(explode('.',$file['filename']));
+ $ext = strtolower(array_pop(explode('.',$file['filename'])));
?>| Attachment | Size |
|---|---|
| filefield.lowerext.patch | 1.14 KB |

#1
That sounds like a good idea, but I'm not sure what dopry meant with the line
<?php// @todo: trim & strtolower file_extenstions with a formapi validate callback.
?>
Can we have the above patch nevertheless? Where should that validate happen? The answer my friend, etc.
#2
No answer in quite some time means I can commit this. Applied, enjoy! (at least, as long as that version of the icon name lookup is still alive, before being replaced with a naming specification compliant, mimetype-based lookup scheme.)
#3
Automatically closed -- issue fixed for two weeks with no activity.