Add unfiltered_upload cap, and allow for admins. Props Nazgul. fixes #4136

git-svn-id: http://svn.automattic.com/wordpress/trunk@5303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n
2007-04-24 23:27:20 +00:00
parent 534eeaf7bc
commit ea9d389751
4 changed files with 23 additions and 2 deletions

View File

@@ -1948,7 +1948,7 @@ function wp_handle_upload( &$file, $overrides = false ) {
return $upload_error_handler( $file, __( 'Specified file failed upload test.' ));
// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
if ( $test_type ) {
if ( $test_type && !current_user_can( 'unfiltered_upload' ) ) {
$wp_filetype = wp_check_filetype( $file['name'], $mimes );
extract( $wp_filetype );