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
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'])));
?>

AttachmentSize
filefield.lowerext.patch1.14 KB

#1

jpetso - April 29, 2008 - 20:49

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

jpetso - May 27, 2008 - 08:09
Status:active» fixed

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

Anonymous (not verified) - June 10, 2008 - 08:13
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.