mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
Hardening: Remove the ability to upload JavaScript files for users who do not have the unfiltered_html
capability.
Merges [42261] to the 4.2 branch. Built from https://develop.svn.wordpress.org/branches/4.2@42295 git-svn-id: http://core.svn.wordpress.org/branches/4.2@42124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a8df162eea
commit
64c1ec2877
@ -2336,8 +2336,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.
|
||||
|
Loading…
Reference in New Issue
Block a user