Make WordPress Core


Ignore:
Timestamp:
02/02/2021 04:51:17 PM (3 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/ajax-actions.php

    r50129 r50146  
    39283928            $url        = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
    39293929
    3930             $size       = @getimagesize( $cropped );
     3930            $size       = wp_getimagesize( $cropped );
    39313931            $image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
    39323932
Note: See TracChangeset for help on using the changeset viewer.