Make WordPress Core


Ignore:
Timestamp:
02/02/2021 04:51:17 PM (4 years ago)
Author:
antpb
Message:

Media: Avoid suppressing errors when using getimagesize().

Previously, all logic utilizing getimagesize() was supressing errors making it difficult to debug usage of the function.

A new wp_getimagesize() function has been added to allow the errors to no longer be suppressed when WP_DEBUG is enabled.

Props Howdy_McGee, SergeyBiryukov, mukesh27, davidbaumwald, noisysocks, hellofromTonya.
Fixes #49889.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-icon.php

    r49692 r50146  
    8888        $url        = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
    8989
    90         $size       = @getimagesize( $cropped );
     90        $size       = wp_getimagesize( $cropped );
    9191        $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
    9292
Note: See TracChangeset for help on using the changeset viewer.