Changeset 37816 for branches/4.2/src/wp-includes/formatting.php
- Timestamp:
- 06/21/2016 02:55:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.2/src/wp-includes/formatting.php
r33518 r37816 1209 1209 * to manipulate at the command line. Replaces spaces and consecutive 1210 1210 * dashes with a single dash. Trims period, dash and underscore from beginning 1211 * and end of filename. 1211 * and end of filename. It is not guaranteed that this function will return a 1212 * filename that is allowed to be uploaded. 1212 1213 * 1213 1214 * @since 2.1.0 … … 1233 1234 $filename = preg_replace( '/[\r\n\t -]+/', '-', $filename ); 1234 1235 $filename = trim( $filename, '.-_' ); 1236 1237 if ( false === strpos( $filename, '.' ) ) { 1238 $mime_types = wp_get_mime_types(); 1239 $filetype = wp_check_filetype( 'test.' . $filename, $mime_types ); 1240 if ( $filetype['ext'] === $filename ) { 1241 $filename = 'unnamed-file.' . $filetype['ext']; 1242 } 1243 } 1235 1244 1236 1245 // Split the filename into a base and extension[s]
Note: See TracChangeset
for help on using the changeset viewer.