Make WordPress Core

Changeset 42449


Ignore:
Timestamp:
01/15/2018 07:43:30 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Media: Bring consistency to getimagesize() error suppression.

Props chasewg, joemcgill, jeremyfelt.
Fixes #42480.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r42407 r42449  
    358358    }
    359359
    360     list( , , $sourceImageType ) = getimagesize( $file );
     360    list( , , $sourceImageType ) = @getimagesize( $file );
    361361
    362362    /*
     
    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."
  • trunk/src/wp-admin/includes/media.php

    r42343 r42449  
    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'];
     
    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'];
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

    r42343 r42449  
    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.