WordPress.org

Make WordPress Core

Ticket #26808: 26808.diff

File 26808.diff, 719 bytes (added by ericlewis, 6 years ago)
  • src/wp-admin/includes/image.php

    diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php
    index 750d22a..f1e72fe 100644
    a b function file_is_valid_image($path) { 
    414414 */
    415415function file_is_displayable_image($path) {
    416416        $info = @getimagesize($path);
     417        $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP );
    417418        if ( empty($info) )
    418419                $result = false;
    419         elseif ( !in_array($info[2], array(IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)) )     // only gif, jpeg and png images can reliably be displayed
     420        elseif ( !in_array( $info[2], $displayable_image_types ) )
    420421                $result = false;
    421422        else
    422423                $result = true;