[wp-trac] [WordPress Trac] #15606: Remove Hardcoded Image Extensions

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 14 15:57:43 UTC 2011


#15606: Remove Hardcoded Image Extensions
---------------------------+------------------------------
 Reporter:  acumensystems  |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------------------

Comment (by Otto42):

 Your logic change here is somewhat wrong.

 The code as-is only uses that hardcoded list of extensions when the mime
 type is "import", which is that exceedingly old way of doing imports. That
 is solely for backwards compatibility.

 The primary image check now is through the image/ mime-type. So being able
 to modify the backwards-compatible list of extensions doesn't make a whole
 lot of sense.

 Also, your patch drops the "import" type, breaking backward compatibility
 there and making the extension check work for all cases, which is
 undesirable.

 Instead, you should add a filter on the "true" or "false" return value,
 thus allowing you to add your own function to return true for
 "application/pdf" or what have you.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15606#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list