Make WordPress Core

Changeset 29737


Ignore:
Timestamp:
09/11/2014 08:14:56 PM (10 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r29729 r29737  
    320320
    321321    // Use image exif/iptc data for title and caption defaults if possible.
    322     } elseif ( $image_meta = @wp_read_image_metadata( $file ) ) {
     322    } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {
    323323        if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
    324324            $title = $image_meta['title'];
Note: See TracChangeset for help on using the changeset viewer.