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. Built from https://develop.svn.wordpress.org/branches/4.5@42283 git-svn-id: http://core.svn.wordpress.org/branches/4.5@42112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8511c84d2c
commit
db1e3afed0
|
@ -2508,8 +2508,9 @@ function get_allowed_mime_types( $user = null ) {
|
||||||
if ( function_exists( 'current_user_can' ) )
|
if ( function_exists( 'current_user_can' ) )
|
||||||
$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
|
$unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' );
|
||||||
|
|
||||||
if ( empty( $unfiltered ) )
|
if ( empty( $unfiltered ) ) {
|
||||||
unset( $t['htm|html'] );
|
unset( $t['htm|html'], $t['js'] );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter list of allowed mime types and file extensions.
|
* Filter list of allowed mime types and file extensions.
|
||||||
|
|
Loading…
Reference in New Issue