mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-17 02:54:31 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@50146 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -791,7 +791,7 @@ endif;
|
||||
}
|
||||
|
||||
if ( file_exists( $file ) ) {
|
||||
list( $width, $height, $type, $attr ) = @getimagesize( $file );
|
||||
list( $width, $height, $type, $attr ) = wp_getimagesize( $file );
|
||||
} else {
|
||||
$data = wp_get_attachment_metadata( $attachment_id );
|
||||
$height = isset( $data['height'] ) ? $data['height'] : 0;
|
||||
@@ -1223,7 +1223,7 @@ endif;
|
||||
$parent_url = wp_get_attachment_url( $parent->ID );
|
||||
$url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
|
||||
|
||||
$size = @getimagesize( $cropped );
|
||||
$size = wp_getimagesize( $cropped );
|
||||
$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
|
||||
|
||||
$object = array(
|
||||
|
||||
Reference in New Issue
Block a user