Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 7098)
+++ wp-includes/post.php	(working copy)
@@ -884,10 +884,10 @@
 	$wild = '[-._a-z0-9]*';
 	foreach ( (array) $wildcard_mime_types as $type ) {
 		$type = str_replace('*', $wild, $type);
-		$patternses[1][$type] = $type;
+		$patternses[1][$type] = "^$type$";
 		if ( false === strpos($type, '/') ) {
-			$patternses[2][$type] = "^$type/$wild$";
-			$patternses[3][$type] = "$wild$type$wild";
+			$patternses[2][$type] = "^$type/";
+			$patternses[3][$type] = $type;
 		}
 	}
 	asort($patternses);
@@ -2361,7 +2361,6 @@
 function wp_mime_type_icon( $mime = 0 ) {
 	if ( !is_numeric($mime) )
 		$icon = wp_cache_get("mime_type_icon_$mime");
-
 	if ( empty($icon) ) {
 		$post_id = 0;
 		$post_mimes = array();
@@ -2370,8 +2369,11 @@
 			if ( $post =& get_post( $mime ) ) {
 				$post_id = (int) $post->ID;
 				$ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid);
-				if ( !empty($ext) )
+				if ( !empty($ext) ) {
 					$post_mimes[] = $ext;
+					if ( $ext_type = wp_ext2type( $ext ) )
+						$post_mimes[] = $ext_type;
+				}
 				$mime = $post->post_mime_type;
 			} else {
 				$mime = 0;
@@ -2383,16 +2385,20 @@
 		$icon_files = wp_cache_get('icon_files');
 
 		if ( !is_array($icon_files) ) {
-			$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images' );
-			$icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images' );
+			$icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' );
+			$icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images/crystal' );
 			$dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) );
 			$icon_files = array();
-			foreach ( $dirs as $dir => $uri) {
+			while ( $dirs ) {
+				$dir = array_shift(array_keys($dirs));
+				$uri = array_shift($dirs);
 				if ( $dh = opendir($dir) ) {
 					while ( false !== $file = readdir($dh) ) {
 						$file = basename($file);
+						if ( substr($file, 0, 1) == '.' )
+							continue;
 						if ( !in_array(strtolower(substr($file, -4)), array('.png', '.gif', '.jpg') ) ) {
-							if ( is_dir($file) )
+							if ( is_dir("$dir/$file") )
 								$dirs["$dir/$file"] = "$uri/$file";
 							continue;
 						}
Index: wp-includes/js/swfupload/handlers.js
===================================================================
--- wp-includes/js/swfupload/handlers.js	(revision 7098)
+++ wp-includes/js/swfupload/handlers.js	(working copy)
@@ -117,7 +117,8 @@
 
 // file-specific message
 function wpFileError(fileObj, message) {
-	jQuery('#media-upload-error-' + fileObj.id).show().text(message);
+	jQuery('#media-item-' + fileObj.id + ' .filename').append('<span class="file-error">'+message+'</span> <button type="button" class="button dismiss">'+swfuploadL10n.dismiss+'</button>');
+	jQuery('.dismiss').click(function(){jQuery(this).parents('.media-item').slideUp(200, function(){jQuery(this).remove();})});
 }
 
 function fileQueueError(fileObj, error_code, message)  {
@@ -126,12 +127,15 @@
 		wpQueueError(swfuploadL10n.queue_limit_exceeded);
 	}
 	else if ( error_code == SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT ) {
+		fileQueued(fileObj);
 		wpFileError(fileObj, swfuploadL10n.file_exceeds_size_limit);
 	}
 	else if ( error_code == SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE ) {
+		fileQueued(fileObj);
 		wpFileError(fileObj, swfuploadL10n.zero_byte_file);
 	}
 	else if ( error_code == SWFUpload.QUEUE_ERROR.INVALID_FILETYPE ) {
+		fileQueued(fileObj);
 		wpFileError(fileObj, swfuploadL10n.invalid_filetype);
 	}
 	else {
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 7098)
+++ wp-includes/functions.php	(working copy)
@@ -1175,6 +1175,21 @@
 	return array( 'file' => $new_file, 'url' => $url, 'error' => false );
 }
 
+function wp_ext2type( $ext ) {
+	$ext2type = apply_filters('ext2type', array(
+		'audio' => array('aac','ac3','aif','aiff','mp1','mp2','mp3','m3a','m4a','m4b','ogg','ram','wav','wma'),
+		'video' => array('asf','avi','divx','dv','mov','mpg','mpeg','mp4','mpv','ogm','qt','rm','vob','wmv'),
+		'document' => array('doc','pages','odt','rtf','pdf'),
+		'spreadsheet' => array('xls','numbers','ods'),
+		'interactive' => array('ppt','key','odp','swf'),
+		'text' => array('txt'),
+		'archive' => array('tar','bz2','gz','cab','dmg','rar','sea','sit','sqx','zip'),
+		'code' => array('css','html','php','js'),		
+	));
+	foreach ( $ext2type as $type => $exts )
+		if ( in_array($ext, $exts) )
+			return $type;
+}
 
 function wp_check_filetype( $filename, $mimes = null ) {
 	// Accepted MIME types are set here as PCRE unless provided.
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 7098)
+++ wp-includes/script-loader.php	(working copy)
@@ -88,23 +88,23 @@
 		$this->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2');
 		$this->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2');
 		$this->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2');
-		$this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080227');
+		$this->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080228');
 		// these error messages came from the sample swfupload js, they might need changing.
 		$this->localize( 'swfupload-handlers', 'swfuploadL10n', array(
-				'queue_limit_exceeded' => 'You have attempted to queue too many files.',
-				'file_exceeds_size_limit' => 'The file you have selected is too big.',
-				'zero_byte_file' => 'The file you selected is empty.  Please select another file.',
-				'invalid_filetype' => 'The file you choose is not an allowed file type.',
-				'default_error' => 'An error occurred in the upload. Please try again later.',
-				'missing_upload_url' => 'There was a configuration error.  Please contact the server administrator.',
-				'upload_limit_exceeded' => 'You may only upload 1 file.',
-				'http_error' => 'HTTP error.',
-				'upload_failed' => 'Upload failed.',
-				'io_error' => 'IO error.',
-				'security_error' => 'Security error.',
-				'file_cancelled' => 'File cancelled.',
-				'upload_stopped' => 'Upload stopped.',
-
+				'queue_limit_exceeded' => __('You have attempted to queue too many files.'),
+				'file_exceeds_size_limit' => __('This file is too big. See php.ini.'),
+				'zero_byte_file' => __('The file you selected is empty. Please select another file.'),
+				'invalid_filetype' => __('The file you choose is not an allowed file type.'),
+				'default_error' => __('An error occurred in the upload. Please try again later.'),
+				'missing_upload_url' => __('There was a configuration error. Please contact the server administrator.'),
+				'upload_limit_exceeded' => __('You may only upload 1 file.'),
+				'http_error' => __('HTTP error.'),
+				'upload_failed' => __('Upload failed.'),
+				'io_error' => __('IO error.'),
+				'security_error' => __('Security error.'),
+				'file_cancelled' => __('File cancelled.'),
+				'upload_stopped' => __('Upload stopped.'),
+				'dismiss' => __('Dismiss'),
 		) );
 
 		$this->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui.tabs.js', array('jquery'), '3' );
Index: wp-admin/css/media.css
===================================================================
--- wp-admin/css/media.css	(revision 7098)
+++ wp-admin/css/media.css	(working copy)
@@ -21,6 +21,12 @@
 	color: #f00;
 }
 
+.file-error {
+	font-weight: bold;
+	color: #f00;
+	margin: 0 15px;
+}
+
 form {
 	margin: 1em;
 }
