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
This commit is contained in:
Sergey Biryukov 2019-09-20 22:18:59 +00:00
parent ff38f6fb20
commit a879bcb1c6
2 changed files with 2 additions and 7 deletions

View File

@ -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 ) ) {

View File

@ -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.