mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-06 21:54:28 +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:
@@ -1948,7 +1948,7 @@ function get_attachment_icon( $id = 0, $fullsize = false, $max_dims = false ) {
|
||||
// Do we need to constrain the image?
|
||||
if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) {
|
||||
|
||||
$imagesize = @getimagesize($src_file);
|
||||
$imagesize = wp_getimagesize($src_file);
|
||||
|
||||
if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) {
|
||||
$actual_aspect = $imagesize[0] / $imagesize[1];
|
||||
|
||||
Reference in New Issue
Block a user