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. git-svn-id: https://develop.svn.wordpress.org/trunk@46217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8991815b62
commit
f3a0da9fca
@ -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 ) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user