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

Merges [42261] to the 4.9 branch.

Built from https://develop.svn.wordpress.org/branches/4.9@42267


git-svn-id: http://core.svn.wordpress.org/branches/4.9@42096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2017-11-29 16:12:18 +00:00
parent e75247a179
commit b4a3edc859
2 changed files with 4 additions and 3 deletions

View File

@ -2561,8 +2561,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.

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.9.1-beta1-42266';
$wp_version = '4.9.1-beta1-42267';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.