Ticket #52826: trac-52826.diff
| File trac-52826.diff, 1.3 KB (added by , 5 years ago) |
|---|
-
wp-includes/media.php
4979 4979 * @param array $imageinfo Extended image information, passed by reference. 4980 4980 * @return array|false Array of image information or false on failure. 4981 4981 */ 4982 function wp_getimagesize( $filename, &$imageinfo = array()) {4982 function wp_getimagesize( $filename, &$imageinfo = null ) { 4983 4983 if ( 4984 4984 // Skip when running unit tests. 4985 4985 ! defined( 'WP_RUN_CORE_TESTS' ) … … 4987 4987 // Return without silencing errors when in debug mode. 4988 4988 defined( 'WP_DEBUG' ) && WP_DEBUG 4989 4989 ) { 4990 return getimagesize( $filename, $imageinfo ); 4990 if ( ! is_null( $imageinfo ) ) { 4991 return getimagesize( $filename, $imageinfo ); 4992 } else { 4993 return getimagesize( $filename ); 4994 } 4991 4995 } 4992 4996 4993 4997 /* … … 4998 5002 * even when it's able to provide image size information. 4999 5003 * 5000 5004 * See https://core.trac.wordpress.org/ticket/42480 5001 *5002 * phpcs:ignore WordPress.PHP.NoSilencedErrors5003 5005 */ 5004 return @getimagesize( $filename, $imageinfo ); 5006 if ( ! is_null( $imageinfo ) ) { 5007 // phpcs:ignore WordPress.PHP.NoSilencedErrors 5008 return @getimagesize( $filename, $imageinfo ); 5009 } else { 5010 // phpcs:ignore WordPress.PHP.NoSilencedErrors 5011 return @getimagesize( $filename ); 5012 } 5005 5013 }