Changeset 37822 for branches/3.9/src/wp-includes/formatting.php
- Timestamp:
- 06/21/2016 02:58:56 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/src/wp-includes/formatting.php
r33523 r37822 1025 1025 * to manipulate at the command line. Replaces spaces and consecutive 1026 1026 * dashes with a single dash. Trims period, dash and underscore from beginning 1027 * and end of filename. 1027 * and end of filename. It is not guaranteed that this function will return a 1028 * filename that is allowed to be uploaded. 1028 1029 * 1029 1030 * @since 2.1.0 … … 1048 1049 $filename = preg_replace('/[\s-]+/', '-', $filename); 1049 1050 $filename = trim($filename, '.-_'); 1051 1052 if ( false === strpos( $filename, '.' ) ) { 1053 $mime_types = wp_get_mime_types(); 1054 $filetype = wp_check_filetype( 'test.' . $filename, $mime_types ); 1055 if ( $filetype['ext'] === $filename ) { 1056 $filename = 'unnamed-file.' . $filetype['ext']; 1057 } 1058 } 1050 1059 1051 1060 // Split the filename into a base and extension[s]
Note: See TracChangeset
for help on using the changeset viewer.