Ticket #38231: 38231.diff
File 38231.diff, 810 bytes (added by , 8 years ago) |
---|
-
src/wp-admin/includes/file.php
512 512 return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) ); 513 513 } 514 514 515 $content_disposition = wp_remote_retrieve_header( $response, 'Content-Disposition' ); 516 if( ! empty( $content_disposition ) && preg_match( '/filename="([^ ]+)"/', $content_disposition, $matches ) ) { 517 $new_filename = wp_tempnam( $matches[1] ); 518 rename( $tmpfname, $new_filename ); 519 $tmpfname = $new_filename; 520 } 521 515 522 $content_md5 = wp_remote_retrieve_header( $response, 'content-md5' ); 516 523 if ( $content_md5 ) { 517 524 $md5_check = verify_file_md5( $tmpfname, $content_md5 );