Make WordPress Core


Ignore:
Timestamp:
03/06/2015 08:37:08 PM (12 years ago)
Author:
wonderboymusic
Message:

Add unit tests for wp_attachment_is(), checks the whitelist and arbitrary extension.

See #25275.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r31646 r31647  
    50925092
    50935093        $check = wp_check_filetype( $file );
    5094         if ( empty( $check['ext'] ) || 'import' !== $post->post_mime_type ) {
     5094        if ( empty( $check['ext'] ) ) {
    50955095                return false;
    50965096        }
     5097
    50975098        $ext = $check['ext'];
     5099
     5100        if ( 'import' !== $post->post_mime_type ) {
     5101                return $type === $ext;
     5102        }
    50985103
    50995104        switch ( $type ) {
Note: See TracChangeset for help on using the changeset viewer.