[wp-trac] [WordPress Trac] #30320: wp_attachment_is_image() return false if extension is Uppercase

WordPress Trac noreply at wordpress.org
Fri Nov 14 18:46:00 UTC 2014


#30320: wp_attachment_is_image() return false if extension is Uppercase
--------------------------+------------------------------
 Reporter:  netinial      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  4.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by voldemortensen):

 I am unable to reproduce this using a file with .PNG as the extension.
 Additionally, wp_attachment_is_image() uses strtolower() on the extension
 it finds, so it's lower cased when it does the comparison. However,
 wp_attachment_is_image() is a little misleading. You have to use the
 $post_id of the image itself, not the $post_id of the post you embed the
 image in.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30320#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list