Make WordPress Core

Ticket #42480: 42480.3.diff

File 42480.3.diff, 2.7 KB (added by jeremyfelt, 7 years ago)
  • src/wp-admin/includes/image.php

     
    357357                return false;
    358358        }
    359359
    360         list( , , $sourceImageType ) = getimagesize( $file );
     360        list( , , $sourceImageType ) = @getimagesize( $file );
    361361
    362362        /*
    363363         * EXIF contains a bunch of data we'll probably never need formatted in ways
     
    386386         * as caption, description etc.
    387387         */
    388388        if ( is_callable( 'iptcparse' ) ) {
    389                 getimagesize( $file, $info );
     389                @getimagesize( $file, $info );
    390390
    391391                if ( ! empty( $info['APP13'] ) ) {
    392                         $iptc = iptcparse( $info['APP13'] );
     392                        $iptc = @iptcparse( $info['APP13'] );
    393393
    394394                        // Headline, "A brief synopsis of the caption."
    395395                        if ( ! empty( $iptc['2#105'][0] ) ) {
  • src/wp-admin/includes/media.php

     
    368368                        $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
    369369                }
    370370
    371                 // Use image exif/iptc data for title and caption defaults if possible.
    372         } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {
     371        // Use image exif/iptc data for title and caption defaults if possible.
     372        } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) {
    373373                if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
    374374                        $title = $image_meta['title'];
    375375                }
     
    437437        $content = '';
    438438
    439439        // Use image exif/iptc data for title and caption defaults if possible.
    440         if ( $image_meta = @wp_read_image_metadata( $file ) ) {
     440        if ( $image_meta = wp_read_image_metadata( $file ) ) {
    441441                if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
    442442                        $title = $image_meta['title'];
    443443                }
  • src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

     
    123123                $file = $file['file'];
    124124
    125125                // use image exif/iptc data for title and caption defaults if possible
    126                 $image_meta = @wp_read_image_metadata( $file );
     126                $image_meta = wp_read_image_metadata( $file );
    127127
    128128                if ( ! empty( $image_meta ) ) {
    129129                        if ( empty( $request['title'] ) && trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {