Ticket #22149: 22149.diff
File 22149.diff, 1.9 KB (added by , 12 years ago) |
---|
-
wp-admin/custom-header.php
763 763 */ 764 764 function step_2_manage_upload() { 765 765 $overrides = array('test_form' => false); 766 $file = wp_handle_upload($_FILES['import'], $overrides);767 766 767 // Allowed mime types for header images. 768 $allowed_mime_types = array( 769 'image/jpeg', 770 'image/gif', 771 'image/png', 772 'image/bmp', 773 'image/tiff', 774 'image/x-icon', 775 ); 776 777 $file = $_FILES['import']; 778 $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], false ); 779 if ( ! in_array( $wp_filetype['type'], $allowed_mime_types ) ) 780 wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) ); 781 782 $file = wp_handle_upload($file, $overrides); 783 768 784 if ( isset($file['error']) ) 769 785 wp_die( $file['error'], __( 'Image Upload Error' ) ); 770 786 -
wp-admin/custom-background.php
358 358 359 359 check_admin_referer('custom-background-upload', '_wpnonce-custom-background-upload'); 360 360 $overrides = array('test_form' => false); 361 $file = wp_handle_upload($_FILES['import'], $overrides);362 361 362 // Allowed mime types for background images. 363 $allowed_mime_types = array( 364 'image/jpeg', 365 'image/gif', 366 'image/png', 367 'image/bmp', 368 'image/tiff', 369 'image/x-icon', 370 ); 371 372 $file = $_FILES['import']; 373 $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], false ); 374 if ( ! in_array( $wp_filetype['type'], $allowed_mime_types ) ) 375 wp_die( __( 'The uploaded file is not a valid image. Please try again.' ) ); 376 377 $file = wp_handle_upload($file, $overrides); 378 363 379 if ( isset($file['error']) ) 364 380 wp_die( $file['error'] ); 365 381