mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-13 05:10:18 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@42780 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user