Ticket #12518: mimetype2.patch
File mimetype2.patch, 866 bytes (added by , 15 years ago) |
---|
-
xmlrpc.php
2801 2801 $name = "wpid{$old_file->ID}-{$filename}"; 2802 2802 } 2803 2803 2804 $upload = wp_upload_bits($name, $type, $bits);2804 $upload = wp_upload_bits($name, null, $bits); 2805 2805 if ( ! empty($upload['error']) ) { 2806 2806 $errorString = sprintf(__('Could not write file %1$s (%2$s)'), $name, $upload['error']); 2807 2807 logIO('O', '(MW) ' . $errorString); 2808 2808 return new IXR_Error(500, $errorString); 2809 2809 } 2810 2811 //if we don't know the type of the file, try to figure it out... 2812 if(!isset($type) || $type == '') { 2813 $wp_filetype = wp_check_filetype( $name ); 2814 2815 if ( $wp_filetype['type'] ) { 2816 $type = $wp_filetype['type']; 2817 } 2818 } 2810 2819 // Construct the attachment array 2811 2820 // attach to post_id 0 2812 2821 $post_id = 0;