Make WordPress Core

Ticket #26823: multi_resize_null_support.2.patch

File multi_resize_null_support.2.patch, 1.6 KB (added by pbearne, 11 years ago)

Patch with no check for missing height and width

  • wp-includes/class-wp-image-editor-gd.php

     
    205205                $orig_size = $this->size;
    206206
    207207                foreach ( $sizes as $size => $size_data ) {
    208                         if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
    209                                 continue;
    210 
    211208                        if ( ! isset( $size_data['crop'] ) )
    212209                                $size_data['crop'] = false;
    213210
    214                         $image = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
     211                        $image = $this->_resize( absint( $size_data['width'] ), absint( $size_data['height'] ), $size_data['crop'] );
    215212
    216213                        if( ! is_wp_error( $image ) ) {
    217214                                $resized = $this->_save( $image );
  • wp-includes/class-wp-image-editor-imagick.php

     
    272272                        if ( ! $this->image )
    273273                                $this->image = $orig_image->getImage();
    274274
    275                         if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
    276                                 continue;
    277 
    278275                        if ( ! isset( $size_data['crop'] ) )
    279276                                $size_data['crop'] = false;
    280277
    281                         $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
     278                        $resize_result = $this->resize( absint( $size_data['width'] ), absint( $size_data['height'] ), $size_data['crop'] );
    282279
    283280                        if( ! is_wp_error( $resize_result ) ) {
    284281                                $resized = $this->_save( $this->image );