diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 9248c7e620..4f743ac9a5 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -51,7 +51,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor { if ( $this->image ) return true; - if ( ! file_exists( $this->file ) ) + if ( ! is_file( $this->file ) ) return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); // Set artificially high because GD uses uncompressed images in memory diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index 9d2c8220f5..ef0ccb33f1 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -52,7 +52,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { if ( $this->image ) return true; - if ( ! file_exists( $this->file ) ) + if ( ! is_file( $this->file ) ) return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); try { diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index abdd265e3a..9e99614c49 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -3221,7 +3221,7 @@ function wp_load_image( $file ) { if ( is_numeric( $file ) ) $file = get_attached_file( $file ); - if ( ! file_exists( $file ) ) + if ( ! is_file( $file ) ) return sprintf(__('File “%s” doesn’t exist?'), $file); if ( ! function_exists('imagecreatefromstring') )