Hardening: Remove the ability to upload JavaScript files for users who do not have the `unfiltered_html` capability.

git-svn-id: https://develop.svn.wordpress.org/trunk@42261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-11-29 15:59:41 +00:00
parent 0b11b6ea36
commit e2fdcb93f1
1 changed files with 3 additions and 2 deletions

View File

@ -2565,8 +2565,9 @@ function get_allowed_mime_types( $user = null ) {
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'] );
if ( empty( $unfiltered ) ) {
unset( $t['htm|html'], $t['js'] );
}
/**
* Filters list of allowed mime types and file extensions.