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-includes/deprecated.php

    r49992 r50146  
    19491949    if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
    19501950
    1951         $imagesize = @getimagesize($src_file);
     1951        $imagesize = wp_getimagesize($src_file);
    19521952
    19531953        if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
Note: See TracChangeset for help on using the changeset viewer.