diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 2cab41acd7..2390adca33 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2043,8 +2043,10 @@ function get_allowed_mime_types( $user = null ) { $t = wp_get_mime_types(); unset( $t['swf'], $t['exe'] ); - $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); - if ( ! $unfiltered ) + if ( function_exists( 'current_user_can' ) ) + $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); + + if ( empty( $unfiltered ) ) unset( $t['htm|html'] ); return apply_filters( 'upload_mimes', $t, $user );