Index: wordpress/wp-includes/functions.php
===================================================================
--- wordpress/wp-includes/functions.php	(revision 7553)
+++ wordpress/wp-includes/functions.php	(working copy)
@@ -1120,7 +1120,6 @@
 
 // return a filename that is sanitized and unique for the given directory
 function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) {
-	$filename = strtolower( $filename );
 	// separate the filename into a name and extension
 	$info = pathinfo($filename);
 	$ext = $info['extension'];
@@ -1141,8 +1140,7 @@
 		else
 			$ext = strtolower( ".$ext" );
 
-		$filename = str_replace( $ext, '', $filename );
-		$filename = sanitize_title_with_dashes( $filename ) . $ext;
+		$filename = sanitize_title_with_dashes( $name ) . $ext;
 
 		while ( file_exists( $dir . "/$filename" ) ) {
 			if ( '' == "$number$ext" )
