mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Better image extension regexes, so we don't just grab the "jpe" from "jpeg" files in media_sideload_image(). props sivel. fixes #16693
git-svn-id: https://develop.svn.wordpress.org/trunk@21219 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -4036,7 +4036,7 @@ function wp_attachment_is_image( $post_id = 0 ) {
|
||||
|
||||
$ext = preg_match('/\.([^.]+)$/', $file, $matches) ? strtolower($matches[1]) : false;
|
||||
|
||||
$image_exts = array('jpg', 'jpeg', 'gif', 'png');
|
||||
$image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
|
||||
|
||||
if ( 'image/' == substr($post->post_mime_type, 0, 6) || $ext && 'import' == $post->post_mime_type && in_array($ext, $image_exts) )
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user