Skip to content

Commit

Permalink
Hardening: Remove the ability to upload JavaScript files for users wh…
Browse files Browse the repository at this point in the history
…o do not have the `unfiltered_html` capability.

Merges [42261] to the 3.9 branch.

Built from https://develop.svn.wordpress.org/branches/3.9@42307


git-svn-id: http://core.svn.wordpress.org/branches/3.9@42136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
johnbillion committed Nov 29, 2017
1 parent a18a452 commit 2a54362
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wp-includes/functions.php
Expand Up @@ -2229,8 +2229,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.
Expand Down

0 comments on commit 2a54362

Please sign in to comment.