WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/20/2019 10:17:48 PM (2 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r46202 r46217  
    864864 */
    865865function file_is_displayable_image( $path ) {
    866     $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP );
    867 
    868     // IMAGETYPE_ICO is only defined in PHP 5.3+.
    869     if ( defined( 'IMAGETYPE_ICO' ) ) {
    870         $displayable_image_types[] = IMAGETYPE_ICO;
    871     }
     866    $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO );
    872867
    873868    $info = @getimagesize( $path );
Note: See TracChangeset for help on using the changeset viewer.