Index: wp-atom.php
===================================================================
--- wp-atom.php	(revision 4903)
+++ wp-atom.php	(working copy)
@@ -44,7 +44,7 @@
 <?php if ( !get_option('rss_use_excerpt') ) : ?>
 		<content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
 <?php endif; ?>
-<?php rss_enclosure(); ?>
+<?php atom_enclosure(); ?>
 <?php do_action('atom_entry'); ?>
 	</entry>
 	<?php endwhile ; ?>
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php	(revision 4903)
+++ wp-includes/feed.php	(working copy)
@@ -195,4 +195,25 @@
 	}
 }
 
-?>
+function atom_enclosure() {
+	global $id, $post;
+	
+	if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) {
+		return;
+	}
+	
+	$custom_fields = get_post_custom();
+	if ( is_array($custom_fields) ) {
+		while ( list($key, $val) = each($custom_fields) ) {
+			if ( $key == 'enclosure' ) {
+				if ( is_array($val) ) {
+					foreach ( (array) $val as $enc ) {
+						$enclosure = split( "\n", $enc );
+						print "<link href='".trim( htmlspecialchars($enclosure[ 0 ]) )."' rel='enclosure' length='".trim( $enclosure[ 1 ] )."' type='".trim( $enclosure[ 2 ] )."'/>\n";
+					}
+				}
+			}
+		}
+	}
+
+?>
\ No newline at end of file

