Make WordPress Core

Changeset 42450


Ignore:
Timestamp:
01/15/2018 08:01:51 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Media: Bring consistency to getimagesize() error suppression.

Props chasewg, joemcgill, jeremyfelt.
Merges [42449] to the 4.9 branch.
Fixes #42480.

Location:
branches/4.9
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/includes/image.php

    r41215 r42450  
    344344        return false;
    345345
    346     list( , , $sourceImageType ) = getimagesize( $file );
     346    list( , , $sourceImageType ) = @getimagesize( $file );
    347347
    348348    /*
     
    373373     */
    374374    if ( is_callable( 'iptcparse' ) ) {
    375         getimagesize( $file, $info );
     375        @getimagesize( $file, $info );
    376376
    377377        if ( ! empty( $info['APP13'] ) ) {
    378             $iptc = iptcparse( $info['APP13'] );
     378            $iptc = @iptcparse( $info['APP13'] );
    379379
    380380            // Headline, "A brief synopsis of the caption."
  • branches/4.9/src/wp-admin/includes/media.php

    r41964 r42450  
    356356
    357357    // Use image exif/iptc data for title and caption defaults if possible.
    358     } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) {
     358    } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) {
    359359        if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
    360360            $title = $image_meta['title'];
     
    420420
    421421    // Use image exif/iptc data for title and caption defaults if possible.
    422     if ( $image_meta = @wp_read_image_metadata($file) ) {
     422    if ( $image_meta = wp_read_image_metadata( $file ) ) {
    423423        if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
    424424            $title = $image_meta['title'];
  • branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r41727 r42450  
    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 ) ) {
Note: See TracChangeset for help on using the changeset viewer.