WordPress.org

Make WordPress Core

Ticket #20657: 20657.patch

File 20657.patch, 724 bytes (added by SergeyBiryukov, 3 years ago)
  • wp-admin/includes/image.php

     
    4444 * @return string|WP_Error|false New filepath on success, WP_Error or false on failure. 
    4545 */ 
    4646function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { 
    47         if ( 0 == $src_x && 0 == $src_y && $src_w == $dst_w && $src_h == $dst_h ) 
    48                 return ( is_numeric( $src ) ) ? get_attached_file( $src ) : $src; 
    49  
    5047        if ( is_numeric( $src ) ) { // Handle int as attachment ID 
    5148                $src_file = get_attached_file( $src ); 
    5249                if ( ! file_exists( $src_file ) ) {