Ticket #4136: 4136fix.diff
File 4136fix.diff, 962 bytes (added by , 17 years ago) |
---|
-
wp-admin/admin-functions.php
1948 1948 return $upload_error_handler( $file, __( 'Specified file failed upload test.' )); 1949 1949 1950 1950 // 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 ) { 1952 1952 $wp_filetype = wp_check_filetype( $file['name'], $mimes ); 1953 1953 1954 1954 extract( $wp_filetype ); 1955 1955 1956 if ( !$type || !$ext)1956 if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) ) 1957 1957 return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' )); 1958 1959 if ( !$ext ) 1960 $ext = strrchr($file['name'], '.'); 1958 1961 } 1959 1962 1960 1963 // A writable uploads dir will pass this test. Again, there's no point overriding this one.