WordPress.org

Make WordPress Core

Ticket #17814: 17814.3.diff

File 17814.3.diff, 1.5 KB (added by DH-Shredder, 19 months ago)

Just check with is_file()

  • wp-includes/class-wp-image-editor-gd.php

    diff --git wp-includes/class-wp-image-editor-gd.php wp-includes/class-wp-image-editor-gd.php
    index 94c2eec..36b9878 100644
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    5151                if ( $this->image ) 
    5252                        return true; 
    5353 
    54                 if ( ! file_exists( $this->file ) ) 
     54                if ( ! is_file( $this->file ) ) 
    5555                        return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 
    5656 
    5757                // Set artificially high because GD uses uncompressed images in memory 
  • wp-includes/class-wp-image-editor-imagick.php

    diff --git wp-includes/class-wp-image-editor-imagick.php wp-includes/class-wp-image-editor-imagick.php
    index 3e35775..5557be2 100644
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    5252                if ( $this->image ) 
    5353                        return true; 
    5454 
    55                 if ( ! file_exists( $this->file ) ) 
     55                if ( ! is_file( $this->file ) ) 
    5656                        return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 
    5757 
    5858                try { 
  • wp-includes/deprecated.php

    diff --git wp-includes/deprecated.php wp-includes/deprecated.php
    index a9744e8..101bc10 100644
    function wp_load_image( $file ) { 
    32213221        if ( is_numeric( $file ) ) 
    32223222                $file = get_attached_file( $file ); 
    32233223 
    3224         if ( ! file_exists( $file ) ) 
     3224        if ( ! is_file( $file ) ) 
    32253225                return sprintf(__('File “%s” doesn’t exist?'), $file); 
    32263226 
    32273227        if ( ! function_exists('imagecreatefromstring') )