Make WordPress Core


Ignore:
Timestamp:
04/30/2007 03:54:50 PM (17 years ago)
Author:
ryan
Message:

unfiltered_upload fix from Nazgul. fixes #4136

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r5308 r5353  
    19491949
    19501950    // A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
    1951     if ( $test_type && !current_user_can( 'unfiltered_upload' ) ) {
     1951    if ( $test_type ) {
    19521952        $wp_filetype = wp_check_filetype( $file['name'], $mimes );
    19531953
    19541954        extract( $wp_filetype );
    19551955
    1956         if ( !$type || !$ext )
     1956        if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
    19571957            return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
     1958       
     1959        if ( !$ext )
     1960            $ext = strrchr($file['name'], '.');
    19581961    }
    19591962
Note: See TracChangeset for help on using the changeset viewer.