Changeset 28426
- Timestamp:
- 05/15/2014 06:21:51 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r28372 r28426 1988 1988 // Do basic extension validation and MIME mapping 1989 1989 $wp_filetype = wp_check_filetype( $filename, $mimes ); 1990 extract( $wp_filetype ); 1990 $ext = $wp_filetype['ext']; 1991 $type = $wp_filetype['type']; 1991 1992 1992 1993 // We can't do any further validation without a file to work with 1993 if ( ! file_exists( $file ) ) 1994 if ( ! file_exists( $file ) ) { 1994 1995 return compact( 'ext', 'type', 'proper_filename' ); 1996 } 1995 1997 1996 1998 // We're able to validate images using GD … … 2024 2026 $new_filename = implode( '.', $filename_parts ); 2025 2027 2026 if ( $new_filename != $filename ) 2028 if ( $new_filename != $filename ) { 2027 2029 $proper_filename = $new_filename; // Mark that it changed 2028 2030 } 2029 2031 // Redefine the extension / MIME 2030 2032 $wp_filetype = wp_check_filetype( $new_filename, $mimes ); 2031 extract( $wp_filetype ); 2033 $ext = $wp_filetype['ext']; 2034 $type = $wp_filetype['type']; 2032 2035 } 2033 2036 }
Note: See TracChangeset
for help on using the changeset viewer.