From 55960178781afb046a8642c7bf80cd195181396b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 5 Mar 2018 01:03:31 +0000 Subject: [PATCH] Media: Recognize `.ico` files as displayable images on PHP 5.3+ and allow attachment meta data to be generated for them. Props remyvv, Guido07111975. Fixes #43458. Built from https://develop.svn.wordpress.org/trunk@42780 git-svn-id: http://core.svn.wordpress.org/trunk@42610 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 0f03e2ca42..573f107605 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -556,6 +556,11 @@ function file_is_valid_image( $path ) { 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; + } + $info = @getimagesize( $path ); if ( empty( $info ) ) { $result = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index a918f6b97d..e87ab047d8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42779'; +$wp_version = '5.0-alpha-42780'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.