mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
In media_handle_upload(), don't call wp_read_image_metadata() on things that aren't images (like videos). We never caught this error, because we are suppressing it by calling @wp_read_image_metadata().
Props jrf for the initial patch. Fixes #28907. git-svn-id: https://develop.svn.wordpress.org/trunk@29737 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -319,7 +319,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||
$content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
|
||||
|
||||
// Use image exif/iptc data for title and caption defaults if possible.
|
||||
} elseif ( $image_meta = @wp_read_image_metadata( $file ) ) {
|
||||
} elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {
|
||||
if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
|
||||
$title = $image_meta['title'];
|
||||
if ( trim( $image_meta['caption'] ) )
|
||||
|
||||
Reference in New Issue
Block a user