Changeset 28416 for trunk/src/wp-admin/includes/file.php
- Timestamp:
- 05/15/2014 04:28:24 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r28268 r28416 422 422 if ( $test_type ) { 423 423 $wp_filetype = wp_check_filetype_and_ext( $file['tmp_name'], $file['name'], $mimes ); 424 425 extract( $wp_filetype ); 424 $ext = empty( $wp_filetype['ext'] ) ? '' : $wp_filetype['ext']; 425 $type = empty( $wp_filetype['type'] ) ? '' : $wp_filetype['type']; 426 $proper_filename = empty( $wp_filetype['proper_filename'] ) ? '' : $wp_filetype['proper_filename']; 426 427 427 428 // Check to see if wp_check_filetype_and_ext() determined the filename was incorrect 428 if ( $proper_filename ) 429 if ( $proper_filename ) { 429 430 $file['name'] = $proper_filename; 430 431 if ( ( ! $type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )432 return $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' ) );433 434 if ( ! $type )431 } 432 if ( ( ! $type || ! $ext ) && ! current_user_can( 'unfiltered_upload' ) ) { 433 return $upload_error_handler( $file, __( 'Sorry, this file type is not permitted for security reasons.' ) ); 434 } 435 if ( ! $type ) { 435 436 $type = $file['type']; 437 } 436 438 } 437 439
Note: See TracChangeset
for help on using the changeset viewer.