Account for unfiltered_upload cap in wp_upload_bits(). see #21292.

git-svn-id: http://core.svn.wordpress.org/trunk@22471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-08 20:41:34 +00:00
parent b8140cf35e
commit e5c1d8d7af
1 changed files with 1 additions and 1 deletions

View File

@ -1677,7 +1677,7 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
return array( 'error' => __( 'Empty filename' ) );
$wp_filetype = wp_check_filetype( $name );
if ( !$wp_filetype['ext'] )
if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) )
return array( 'error' => __( 'Invalid file type' ) );
$upload = wp_upload_dir( $time );