diff -ru wp-svn/trunk/wp-atom.php wp-work/trunk/wp-atom.php
--- wp-svn/trunk/wp-atom.php	2005-11-23 01:35:16.723150208 +0000
+++ wp-work/trunk/wp-atom.php	2005-12-15 22:39:29.188503320 +0000
@@ -1,45 +1,59 @@
 <?php
+// Atom 1.0 feed generator for WordPress
+// Distributed under the terms of the GNU General Public License v2
 
-if (empty($wp)) {
-	require_once('wp-config.php');
-	wp('feed=atom');
+if (empty($feed)) {
+	$blog = 1;
+	$feed = 'atom';
+	$doing_rss = 1;
+	require('wp-blog-header.php');
 }
 
 header('Content-type: application/atom+xml; charset=' . get_settings('blog_charset'), true);
 $more = 1;
-
 ?>
-<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'; ?>
-<feed version="0.3"
-  xmlns="http://purl.org/atom/ns#"
-  xmlns:dc="http://purl.org/dc/elements/1.1/"
-  xml:lang="<?php echo get_option('rss_language'); ?>"
-  <?php do_action('atom_ns'); ?>
-  >
-	<title><?php bloginfo_rss('name') ?></title>
-	<link rel="alternate" type="text/html" href="<?php bloginfo_rss('home') ?>" />
-	<tagline><?php bloginfo_rss("description") ?></tagline>
-	<modified><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></modified>
-	<copyright>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></copyright>
-	<generator url="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
+<?php echo '<?xml version="1.0" encoding="'.get_settings('blog_charset').'"?'.'>'."\n"; ?>
+<feed xmlns="http://www.w3.org/2005/Atom"
+      xml:lang="<?php echo get_option('rss_language'); ?>"
+      <?php do_action('atom_ns'); ?>>
+	<title><?php bloginfo_rss('name'); ?></title>
+	<subtitle><?php bloginfo_rss('description'); ?></subtitle>
+	<id><?php bloginfo('url'); ?>/</id>
+	<link rel="self" type="application/atom+xml" href="<?php bloginfo('atom_url'); ?>"/>
+	<link rel="alternate" type="<?php bloginfo('html_type'); ?>" href="<?php bloginfo_rss('home'); ?>/"/>
+	<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_lastpostmodified('GMT'), false); ?></updated>
+	<rights>Copyright <?php echo mysql2date('Y', get_lastpostdate('blog'), 0); ?></rights>
+	<generator uri="http://wordpress.org/" version="<?php bloginfo_rss('version'); ?>">WordPress</generator>
 	<?php do_action('atom_head'); ?>
-	<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
+<?php $items_count = 0; if ($posts) { foreach ($posts as $post) { start_wp(); ?>
 	<entry>
-	  	<author>
-			<name><?php the_author() ?></name>
+		<author>
+			<name><?php the_author(); ?></name>
 		</author>
-		<title type="text/html" mode="escaped"><![CDATA[<?php the_title_rss() ?>]]></title>
-		<link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />
-		<id><?php the_guid(); ?></id>
-		<modified><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></modified>
-		<issued><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></issued>
-		<?php the_category_rss('rdf') ?> 
-		<summary type="text/plain" mode="escaped"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>
+		<title type="html"><![CDATA[ <?php the_title_rss(); ?> ]]></title>
+		<link rel="alternate" type="<?php bloginfo('html_type'); ?>" href="<?php permalink_single_rss(); ?>"/>
+		<id><?php permalink_single_rss(); ?></id>
+		<published><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></published>
+		<updated><?php echo mysql2date('Y-m-d\TH:i:s\Z',$post->post_modified_gmt); ?></updated>
+<?php
+	$categories_path = get_category_link(0);
+	$categories = get_the_category();
+	foreach ($categories as $cat) { ?>
+		<category scheme="<?php echo $categories_path; ?>"
+		          term="<?php $foo = "/" . str_replace('/','\/',$categories_path) . "/";
+							echo preg_replace($foo,'',get_category_link($cat->cat_ID)); ?>"
+		          label="<?php echo $cat->cat_name; ?>"/>
+<?php } ?>
+		<summary type="html">
+			<![CDATA[ <?php the_excerpt_rss(); ?> ]]>
+		</summary>
 <?php if ( !get_settings('rss_use_excerpt') ) : ?>
-		<content type="<?php bloginfo('html_type'); ?>" mode="escaped" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>
+		<content type="html">
+			<![CDATA[ <?php the_content('', 0, '') ?> ]]>
+		</content>
+		<?php atom_enclosure(); ?>
+		<?php do_action('atom_entry'); ?>
 <?php endif; ?>
-<?php rss_enclosure(); ?>
-<?php do_action('atom_entry'); ?>
 	</entry>
-	<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
-</feed>
+<?php $items_count++; if (($items_count == get_settings('posts_per_rss')) && empty($m)) { break; } } } ?>
+</feed>
\ No newline at end of file
diff -ru wp-svn/trunk/wp-content/themes/classic/header.php wp-work/trunk/wp-content/themes/classic/header.php
--- wp-svn/trunk/wp-content/themes/classic/header.php	2005-11-23 01:35:14.348511208 +0000
+++ wp-work/trunk/wp-content/themes/classic/header.php	2005-12-15 22:40:21.465556000 +0000
@@ -5,7 +5,7 @@
 	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
 
 	<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
-	
+
 	<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
 
 	<style type="text/css" media="screen">
@@ -14,8 +14,8 @@
 
 	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
 	<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
-	<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
-	
+	<link rel="alternate" type="application/atom+xml" title="Atom 1.0 feed" href="<?php bloginfo('atom_url'); ?>" />
+
 	<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
     <?php wp_get_archives('type=monthly&format=link'); ?>
 	<?php //comments_popup_script(); // off by default ?>
diff -ru wp-svn/trunk/wp-content/themes/default/header.php wp-work/trunk/wp-content/themes/default/header.php
--- wp-svn/trunk/wp-content/themes/default/header.php	2005-11-23 01:35:14.646465912 +0000
+++ wp-work/trunk/wp-content/themes/default/header.php	2005-12-15 22:42:11.317855912 +0000
@@ -9,6 +9,7 @@
 <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
 
 <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
+<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
 <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
 <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
 
@@ -16,21 +17,21 @@
 /*	To accomodate differing install paths of WordPress, images are referred only here,
 	and not in the wp-layout.css file. If you prefer to use only CSS for colors and what
 	not, then go right ahead and delete the following lines, and the image files. */
-		
-	body { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgcolor.jpg"); }	
+
+	body { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgcolor.jpg"); }
 <?php /* Checks to see whether it needs a sidebar or not */ if ((! $withcomments) && (! is_single())) { ?>
 	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg.jpg") repeat-y top; border: none; }
 <?php } else { // No sidebar ?>
-	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; } 
+	#page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
 <?php } ?>
 	#header { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg") no-repeat bottom center; }
 	#footer { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickfooter.jpg") no-repeat bottom; border: none;}
 
 /*	Because the template is slightly different, size-wise, with images, this needs to be set here
 	If you don't want to use the template's images, you can also delete the following two lines. */
-		
+
 	#header 	{ margin: 0 !important; margin: 0 0 0 1px; padding: 1px; height: 198px; width: 758px; }
-	#headerimg 	{ margin: 7px 9px 0; height: 192px; width: 740px; } 
+	#headerimg 	{ margin: 7px 9px 0; height: 192px; width: 740px; }
 
 /* 	To ease the insertion of a personal header image, I have done it in such a way,
 	that you simply drop in an image called 'personalheader.jpg' into your /images/
diff -ru wp-svn/trunk/wp-includes/feed-functions.php wp-work/trunk/wp-includes/feed-functions.php
--- wp-svn/trunk/wp-includes/feed-functions.php	2005-11-23 01:35:14.083551488 +0000
+++ wp-work/trunk/wp-includes/feed-functions.php	2005-12-15 22:38:27.633861048 +0000
@@ -99,7 +99,7 @@
 				 $link = get_author_link(0, $author_id, $author_nicename);
 				 $link = $link . "feed/";
        }
-			 
+
 			 $link = apply_filters('author_feed_link', $link);
 
        if ($echo) echo $link;
@@ -142,7 +142,7 @@
 
 	$custom_fields = get_post_custom();
 	if( is_array( $custom_fields ) ) {
-		while( list( $key, $val ) = each( $custom_fields ) ) { 
+		while( list( $key, $val ) = each( $custom_fields ) ) {
 			if( $key == 'enclosure' ) {
 				if (is_array($val)) {
 					foreach($val as $enc) {
@@ -155,4 +155,22 @@
 	}
 }
 
+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($val as $enc) {
+						$enclosure = split( "\n", $enc );
+						print "<link rel=\"enclosure\" href=\"".trim( htmlspecialchars($enclosure[ 0 ]) )."\" length=\"".trim( $enclosure[ 1 ] )."\" type=\"".trim( $enclosure[ 2 ] )."\"/>\n";
+					}
+				}
+			}
+		}
+	}
+}
 ?>
\ No newline at end of file
