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

    r50144 r50146  
    245245
    246246        if ( $thumb_file ) {
    247             $info = @getimagesize( $thumb_file );
     247            $info = wp_getimagesize( $thumb_file );
    248248        }
    249249
     
    963963
    964964                $src_file               = $icon_dir . '/' . wp_basename( $src );
    965                 list( $width, $height ) = @getimagesize( $src_file );
     965                list( $width, $height ) = wp_getimagesize( $src_file );
    966966            }
    967967        }
Note: See TracChangeset for help on using the changeset viewer.