Index: wp-admin/inline-uploading.php
===================================================================
--- wp-admin/inline-uploading.php	(revision 3378)
+++ wp-admin/inline-uploading.php	(working copy)
@@ -86,7 +86,7 @@
 
 		if ( @file_exists($thumb) ) {
 			$newdata = $imagedata;
-			$newdata['thumb'] = basename($thumb);
+			$newdata['thumb'] = rawurlencode(basename($thumb));
 			update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata);
 		} else {
 			$error = $thumb;
@@ -215,7 +215,7 @@
 		$uwidth_sum += 128;
 		if ( preg_match('!^image/!', $attachment['post_mime_type'] ) ) {
 			$image = & $attachment;
-			if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.$image['thumb']) ) {
+			if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.rawurldecode($image['thumb'])) ) {
 				$src = str_replace(basename($image['guid']), $image['thumb'], $image['guid']);
 				$script .= "srca[{$ID}] = '$src';
 srcb[{$ID}] = '{$image['guid']}';
Index: wp-admin/admin-functions.php
===================================================================
--- wp-admin/admin-functions.php	(revision 3378)
+++ wp-admin/admin-functions.php	(working copy)
@@ -743,7 +743,8 @@
 			@ imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]);
 
 			// If no filters change the filename, we'll do a default transformation.
-			if ( basename($file) == $thumb = apply_filters('thumbnail_filename', basename($file)) )
+			$thumb = apply_filters('thumbnail_filename', basename($file));
+			if ( basename($file) == $thumb)
 				$thumb = preg_replace('!(\.[^.]+)?$!', __('.thumbnail').'$1', basename($file), 1);
 
 			$thumbpath = str_replace(basename($file), $thumb, $file);
@@ -764,7 +765,6 @@
 					$error = __("Thumbnail path invalid");
 				}
 			}
-
 		}
 	} else {
 		$error = __('File not found');
@@ -1773,7 +1773,7 @@
 	@ chmod($new_file, $perms);
 
 	// Compute the URL
-	$url = $uploads['url'] . "/$filename";
+	$url = $uploads['url'] . "/" . rawurlencode($filename);
 
 	return array('file' => $new_file, 'url' => $url, 'type' => $type);
 }

