Changeset 49019
- Timestamp:
- 09/20/2020 02:26:38 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-gd.php
r48798 r49019 94 94 wp_raise_memory_limit( 'image' ); 95 95 96 $this->image = @imagecreatefromstring( file_get_contents( $this->file ) ); 96 $file_contents = @file_get_contents( $this->file ); 97 98 if ( ! $file_contents ) { 99 return new WP_Error( 'error_loading_image', __( 'File doesn’t exist?' ), $this->file ); 100 } 101 102 $this->image = @imagecreatefromstring( $file_contents ); 97 103 98 104 if ( ! is_gd_image( $this->image ) ) { … … 101 107 102 108 $size = @getimagesize( $this->file ); 109 103 110 if ( ! $size ) { 104 111 return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file );
Note: See TracChangeset
for help on using the changeset viewer.