Code Modernization: Remove a workaround for IMAGETYPE_ICO in file_is_displayable_image().

The `IMAGETYPE_ICO` constant was introduced in PHP 5.3, so no longer needs a workaround.

Props jrf.
See #48074.

git-svn-id: https://develop.svn.wordpress.org/trunk@46217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-09-20 22:17:48 +00:00
parent 8991815b62
commit f3a0da9fca

View File

@ -863,12 +863,7 @@ function file_is_valid_image( $path ) {
* @return bool True if suitable, false if not suitable. * @return bool True if suitable, false if not suitable.
*/ */
function file_is_displayable_image( $path ) { function file_is_displayable_image( $path ) {
$displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP ); $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO );
// IMAGETYPE_ICO is only defined in PHP 5.3+.
if ( defined( 'IMAGETYPE_ICO' ) ) {
$displayable_image_types[] = IMAGETYPE_ICO;
}
$info = @getimagesize( $path ); $info = @getimagesize( $path );
if ( empty( $info ) ) { if ( empty( $info ) ) {