WordPress.org

Make WordPress Core

Ticket #6821: 6812-fix-wp-error.patch

File 6812-fix-wp-error.patch, 1.3 KB (added by bpetty, 6 years ago)
  • 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 97382d8..9248c7e 100644
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    146146                        return $resized;
    147147                }
    148148
    149                 return WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
     149                return new WP_Error( 'image_resize_error', __('Image resize failed.'), $this->file );
    150150        }
    151151
    152152        /**
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    222222                        return true;
    223223                }
    224224
    225                 return WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
     225                return new WP_Error( 'image_crop_error', __('Image crop failed.'), $this->file );
    226226        }
    227227
    228228        /**
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    246246                                return true;
    247247                        }
    248248                }
    249                 return WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
     249                return new WP_Error( 'image_rotate_error', __('Image rotate failed.'), $this->file );
    250250        }
    251251
    252252        /**
    class WP_Image_Editor_GD extends WP_Image_Editor { 
    273273                                return true;
    274274                        }
    275275                }
    276                 return WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
     276                return new WP_Error( 'image_flip_error', __('Image flip failed.'), $this->file );
    277277        }
    278278
    279279        /**