mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 12:58:25 +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.6 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.6@42279 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fd15f48deb
commit
4a5cb38358
@ -2530,8 +2530,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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user