WordPress.org

Make WordPress Core

Ticket #4136: fix5303.diff

File fix5303.diff, 778 bytes (added by technosailor, 7 years ago)
  • wp-admin/admin-functions.php

     
    19481948                return $upload_error_handler( $file, __( 'Specified file failed upload test.' )); 
    19491949 
    19501950        // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter. 
    1951         if ( $test_type && !current_user_can( 'unfiltered_upload' ) ) { 
     1951        if ( $test_type && current_user_can( 'unfiltered_upload' ) ) { 
    19521952                $wp_filetype = wp_check_filetype( $file['name'], $mimes ); 
    1953  
     1953                 
    19541954                extract( $wp_filetype ); 
    1955  
     1955                 
    19561956                if ( !$type || !$ext ) 
    19571957                        return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); 
    19581958        }