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

git-svn-id: https://develop.svn.wordpress.org/trunk@22471 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-08 20:41:34 +00:00
parent 26fcee62ea
commit 9c33c30f5b
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' ) ); return array( 'error' => __( 'Empty filename' ) );
$wp_filetype = wp_check_filetype( $name ); $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' ) ); return array( 'error' => __( 'Invalid file type' ) );
$upload = wp_upload_dir( $time ); $upload = wp_upload_dir( $time );