Ticket #6427: wp-unique-filename-behaviour-changes-r7553.patch
File wp-unique-filename-behaviour-changes-r7553.patch, 879 bytes (added by , 16 years ago) |
---|
-
wordpress/wp-includes/functions.php
1120 1120 1121 1121 // return a filename that is sanitized and unique for the given directory 1122 1122 function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) { 1123 $filename = strtolower( $filename );1124 1123 // separate the filename into a name and extension 1125 1124 $info = pathinfo($filename); 1126 1125 $ext = $info['extension']; … … 1141 1140 else 1142 1141 $ext = strtolower( ".$ext" ); 1143 1142 1144 $filename = str_replace( $ext, '', $filename ); 1145 $filename = sanitize_title_with_dashes( $filename ) . $ext; 1143 $filename = sanitize_title_with_dashes( $name ) . $ext; 1146 1144 1147 1145 while ( file_exists( $dir . "/$filename" ) ) { 1148 1146 if ( '' == "$number$ext" )