Changeset 37825 for branches/3.7/src/wp-includes/formatting.php
- Timestamp:
- 06/21/2016 03:01:26 PM (10 years ago)
- File:
-
- 1 edited
-
branches/3.7/src/wp-includes/formatting.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7/src/wp-includes/formatting.php
r33525 r37825 946 946 * to manipulate at the command line. Replaces spaces and consecutive 947 947 * dashes with a single dash. Trims period, dash and underscore from beginning 948 * and end of filename. 948 * and end of filename. It is not guaranteed that this function will return a 949 * filename that is allowed to be uploaded. 949 950 * 950 951 * @since 2.1.0 … … 960 961 $filename = preg_replace('/[\s-]+/', '-', $filename); 961 962 $filename = trim($filename, '.-_'); 963 964 if ( false === strpos( $filename, '.' ) ) { 965 $mime_types = wp_get_mime_types(); 966 $filetype = wp_check_filetype( 'test.' . $filename, $mime_types ); 967 if ( $filetype['ext'] === $filename ) { 968 $filename = 'unnamed-file.' . $filetype['ext']; 969 } 970 } 962 971 963 972 // Split the filename into a base and extension[s]
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)