From a879bcb1c66bf6090ed6dbb82919fcdfb8e06d0e Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 22:18:59 +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. Built from https://develop.svn.wordpress.org/trunk@46217 git-svn-id: http://core.svn.wordpress.org/trunk@46029 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 7 +------ wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 12f38049dc..fe7c691e7c 100644 --- a/wp-admin/includes/image.php +++ b/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 ) ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 6581e9a071..e6f889218c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-46216'; +$wp_version = '5.3-alpha-46217'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.