From 9c33c30f5bb1b44c47ffb6bce11f13d58237b6bf Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Thu, 8 Nov 2012 20:41:34 +0000 Subject: [PATCH] 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 --- wp-includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 120cba6582..de157941cc 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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 );