Make WordPress Core

Ticket #28907: media.php.patch

File media.php.patch, 967 bytes (added by jrf, 9 years ago)

Patch as suggested by submitter

  • wp-admin/includes/

    old new  
    318318                        $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
    319319
    320320        // use image exif/iptc data for title and caption defaults if possible
    321         } elseif ( $image_meta = @wp_read_image_metadata( $file ) ) {
    322                 if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
    323                         $title = $image_meta['title'];
    324                 if ( trim( $image_meta['caption'] ) )
    325                         $content = $image_meta['caption'];
     321        } else if ( preg_match( '#^video#', $type ) === false ) {
     322                if ( $image_meta = @wp_read_image_metadata( $file ) ) {
     323                        if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
     324                                $title = $image_meta['title'];
     325                        if ( trim( $image_meta['caption'] ) )
     326                                $content = $image_meta['caption'];
     327                }
    326328        }
    327329
    328330        // Construct the attachment array