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:
Scott Taylor 2014-09-11 20:14:56 +00:00
parent 4d3a00c195
commit 6ed8bab324
1 changed files with 1 additions and 1 deletions

View File

@ -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'] ) )