Ticket #17814: 17814.2.diff

File 17814.2.diff, 1.6 KB (added by DH-Shredder, 8 months ago)

Updated patch for WP_Image_Editor.

  • 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..a72648a 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 ( ! file_exists( $this->file ) || ! 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 6370a53..c8cb964 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 ( ! file_exists( $this->file ) || ! 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..a1d86d2 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 ( ! file_exists( $file ) || ! is_file( $file ) ) 
    32253225                return sprintf(__('File “%s” doesn’t exist?'), $file); 
    32263226 
    32273227        if ( ! function_exists('imagecreatefromstring') )