From f3a0da9fcaf97d2f93c83622c4e61c1f8a198b12 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 22:17:48 +0000 Subject: [PATCH] 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 --- src/wp-admin/includes/image.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index 12f38049dc..fe7c691e7c 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -863,12 +863,7 @@ function file_is_valid_image( $path ) { * @return bool True if suitable, false if not suitable. */ function file_is_displayable_image( $path ) { - $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP ); - - // IMAGETYPE_ICO is only defined in PHP 5.3+. - if ( defined( 'IMAGETYPE_ICO' ) ) { - $displayable_image_types[] = IMAGETYPE_ICO; - } + $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO ); $info = @getimagesize( $path ); if ( empty( $info ) ) {