Ticket #15606: post.php.patch
File post.php.patch, 1.2 KB (added by , 14 years ago) |
---|
-
wp-includes/post.php
3895 3895 3896 3896 $ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false; 3897 3897 3898 $image_exts = array('jpg', 'jpeg', 'gif', 'png'); 3898 // allow adjustments to thumbnailable extensions 3899 $image_exts = apply_filters( 3900 'thumbnailable_extensions', 3901 array('jpg', 'jpeg', 'gif', 'png') 3902 ); 3899 3903 3900 if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) ) 3904 // what do we know about the attachment? 3905 $is_mime_image = 'image/' == substr($post->post_mime_type, 0, 6); 3906 $is_thumbnailable = in_array($ext, $image_exts); 3907 3908 // if the mime type has this as an image, then it's an image 3909 if($is_mime_image) 3901 3910 return true; 3911 3912 // if it's an otherwise imported image, but we accept the file extension... 3913 if($is_thumbnailable) 3914 return true; 3915 3902 3916 return false; 3903 3917 } 3904 3918