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

Merges [42261] to the 4.5 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.5@42283 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2017-11-29 16:25:37 +00:00
parent 8e01813dbf
commit 1989ddbd6a

View File

@ -2508,8 +2508,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'] );
}
/**
* Filter list of allowed mime types and file extensions.