- Timestamp:
- 12/04/2020 09:44:27 PM (4 years ago)
- Location:
- branches/5.6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.6
-
branches/5.6/src/wp-includes/class-wp-image-editor-gd.php
r49019 r49753 324 324 } 325 325 326 $dst = wp_imagecreatetruecolor( $dst_w, $dst_h ); 326 foreach ( array( $src_w, $src_h, $dst_w, $dst_h ) as $value ) { 327 if ( ! is_numeric( $value ) || (int) $value <= 0 ) { 328 return new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file ); 329 } 330 } 331 332 $dst = wp_imagecreatetruecolor( (int) $dst_w, (int) $dst_h ); 327 333 328 334 if ( $src_abs ) { … … 335 341 } 336 342 337 imagecopyresampled( $dst, $this->image, 0, 0, $src_x, $src_y, $dst_w, $dst_h, $src_w,$src_h );343 imagecopyresampled( $dst, $this->image, 0, 0, (int) $src_x, (int) $src_y, (int) $dst_w, (int) $dst_h, (int) $src_w, (int) $src_h ); 338 344 339 345 if ( is_gd_image( $dst ) ) {
Note: See TracChangeset
for help on using the changeset viewer.