Ticket #20657: 20657.2.patch
File 20657.2.patch, 1.1 KB (added by , 13 years ago) |
---|
-
wp-admin/custom-header.php
872 872 wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) ); 873 873 874 874 $cropped = apply_filters('wp_create_file_in_uploads', $cropped, $attachment_id); // For replication 875 $is_cropped = ( get_attached_file( $attachment_id ) != $cropped ); 875 876 876 877 $parent = get_post($attachment_id); 877 878 $parent_url = $parent->guid; … … 909 910 set_theme_mod( 'header_image_data', $header_data ); 910 911 911 912 // cleanup 912 $medium = str_replace( basename($original), 'midsize-'.basename($original), $original);913 $medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original ); 913 914 if ( file_exists( $medium ) ) 914 915 @unlink( apply_filters( 'wp_delete_file', $medium ) ); 915 if ( empty ( $_POST['new-attachment'] ))916 if ( empty( $_POST['new-attachment'] ) && $is_cropped ) 916 917 @unlink( apply_filters( 'wp_delete_file', $original ) ); 917 918 918 919 return $this->finished();