[wp-trac] [WordPress Trac] #49889: Image.php - Wrap Error Suppressors in WP_DEBUG Conditionals
WordPress Trac
noreply at wordpress.org
Sun Apr 12 15:28:11 UTC 2020
#49889: Image.php - Wrap Error Suppressors in WP_DEBUG Conditionals
------------------------------+-----------------------------
Reporter: Howdy_McGee | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version:
Severity: normal | Keywords:
Focuses: coding-standards |
------------------------------+-----------------------------
Ideally, we want to remove all PHP error suppression flags. In some cases
this may not be optimal so an alternative is to wrap any necessary
suppressors in a WP_DEBUG conditional:
{{{
if( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
$imagesize = getimagesize( $file );
} else {
$imagesize = @getimagesize( $file );
}
}}}
This ticket is to track anything and everything we can do to minimize the
suppression flags in the image.php file.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49889>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list