WordPress.org

Make WordPress Core

Changeset 22463


Ignore:
Timestamp:
11/08/2012 02:02:03 AM (6 years ago)
Author:
nacin
Message:

In WP_Image_Editor / wp_load_image(), use is_file() rather than file_exists() so we do not accidentally load a directory.

props benkulbertis, DH-Shredder, scribu.
fixes #17814.

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-image-editor-gd.php

    r22420 r22463  
    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
  • trunk/wp-includes/class-wp-image-editor-imagick.php

    r22421 r22463  
    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
  • trunk/wp-includes/deprecated.php

    r22431 r22463  
    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
Note: See TracChangeset for help on using the changeset viewer.