Index: feed-rss.php
===================================================================
--- feed-rss.php	(revision 11559)
+++ feed-rss.php	(working copy)
@@ -4,12 +4,30 @@
  *
  * @package WordPress
  */
-
-header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
-$more = 1;
-
-echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
-<?php the_generator( 'comment' ); ?>
+ 
+$obsolete_rss092=apply_filters("obsolete_rss092",true);
+if($obsolete_rss092==true):
+	$feed_type="rss2";
+	if(is_category()) {
+		$link=get_category_feed_link($wp_query->get_queried_object_id(),$feed_type,false);
+	}
+	elseif(is_tag()) {
+		$link=get_tag_feed_link($wp_query->get_queried_object_id(),$feed_type,false);
+	}
+	elseif(is_author()) {
+		$link=get_author_feed_link($wp_query->get_queried_object_id(),$feed_type,false);
+	}
+	elseif(is_search()) {
+		$link=get_search_feed_link($wp_query->get_queried_object_id(),$feed_type,false);
+	}
+	else {
+		$link=get_feed_link($feed_type);
+	}
+	wp_redirect($link,301);
+else:
+	header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
+	$more = 1;
+	echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; the_generator( 'comment' ); ?>
 <rss version="0.92">
 <channel>
 	<title><?php bloginfo_rss('name'); wp_title_rss(); ?></title>
@@ -34,3 +52,4 @@
 <?php endwhile; ?>
 </channel>
 </rss>
+<?php endif; ?>
\ No newline at end of file
Index: link-template.php
===================================================================
--- link-template.php	(revision 11559)
+++ link-template.php	(working copy)
@@ -397,7 +397,7 @@
  * @param string $feed Optional. Feed type.
  * @return string
  */
-function get_post_comments_feed_link($post_id = '', $feed = '') {
+function get_post_comments_feed_link($post_id = '', $feed = '', $escape = true) {
 	global $id;
 
 	if ( empty($post_id) )
@@ -414,11 +414,13 @@
 	} else {
 		$type = get_post_field('post_type', $post_id);
 		if ( 'page' == $type )
-			$url = trailingslashit(get_option('home')) . "?feed=$feed&amp;page_id=$post_id";
+			$url = trailingslashit(get_option('home')) . "?feed=$feed&page_id=$post_id";
 		else
-			$url = trailingslashit(get_option('home')) . "?feed=$feed&amp;p=$post_id";
+			$url = trailingslashit(get_option('home')) . "?feed=$feed&p=$post_id";
 	}
-
+	if($escape == true) {
+		$url = esc_url($url);
+	}
 	return apply_filters('post_comments_feed_link', $url);
 }
 
@@ -438,8 +440,8 @@
  * @param string $feed Optional. Feed format.
  * @return string Link to the comment feed for the current post.
 */
-function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) {
-	$url = get_post_comments_feed_link($post_id, $feed);
+function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '', $escape = true) {
+	$url = get_post_comments_feed_link($post_id, $feed, $escape);
 	if ( empty($link_text) )
 		$link_text = __('Comments Feed');
 
@@ -460,7 +462,7 @@
  * @param string $feed Optional. Feed type.
  * @return string Link to the feed for the author specified by $author_id.
 */
-function get_author_feed_link( $author_id, $feed = '' ) {
+function get_author_feed_link( $author_id, $feed = '', $escape = true) {
 	$author_id = (int) $author_id;
 	$permalink_structure = get_option('permalink_structure');
 
@@ -468,7 +470,7 @@
 		$feed = get_default_feed();
 
 	if ( '' == $permalink_structure ) {
-		$link = trailingslashit(get_option('home')) . "?feed=$feed&amp;author=" . $author_id;
+		$link = trailingslashit(get_option('home')) . "?feed=$feed&author=" . $author_id;
 	} else {
 		$link = get_author_posts_url($author_id);
 		if ( $feed == get_default_feed() )
@@ -478,7 +480,9 @@
 
 		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
 	}
-
+	if($escape == true) {
+		$link = esc_url($link);
+	}
 	$link = apply_filters('author_feed_link', $link, $feed);
 
 	return $link;
@@ -498,7 +502,7 @@
  * @param string $feed Optional. Feed type.
  * @return string Link to the feed for the category specified by $cat_id.
 */
-function get_category_feed_link($cat_id, $feed = '') {
+function get_category_feed_link($cat_id, $feed = '', $escape = true) {
 	$cat_id = (int) $cat_id;
 
 	$category = get_category($cat_id);
@@ -512,7 +516,7 @@
 	$permalink_structure = get_option('permalink_structure');
 
 	if ( '' == $permalink_structure ) {
-		$link = trailingslashit(get_option('home')) . "?feed=$feed&amp;cat=" . $cat_id;
+		$link = trailingslashit(get_option('home')) . "?feed=$feed&cat=" . $cat_id;
 	} else {
 		$link = get_category_link($cat_id);
 		if( $feed == get_default_feed() )
@@ -522,7 +526,9 @@
 
 		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
 	}
-
+	if($escape == true) {
+		$link = esc_url($link);
+	}
 	$link = apply_filters('category_feed_link', $link, $feed);
 
 	return $link;
@@ -537,7 +543,7 @@
  * @param string $feed Optional. Feed type.
  * @return string
  */
-function get_tag_feed_link($tag_id, $feed = '') {
+function get_tag_feed_link($tag_id, $feed = '', $escape = true) {
 	$tag_id = (int) $tag_id;
 
 	$tag = get_tag($tag_id);
@@ -551,7 +557,7 @@
 		$feed = get_default_feed();
 
 	if ( '' == $permalink_structure ) {
-		$link = trailingslashit(get_option('home')) . "?feed=$feed&amp;tag=" . $tag->slug;
+		$link = trailingslashit(get_option('home')) . "?feed=$feed&tag=" . $tag->slug;
 	} else {
 		$link = get_tag_link($tag->term_id);
 		if ( $feed == get_default_feed() )
@@ -560,7 +566,9 @@
 			$feed_link = "feed/$feed";
 		$link = trailingslashit($link) . user_trailingslashit($feed_link, 'feed');
 	}
-
+	if($escape == true) {
+		$link = esc_url($link);
+	}
 	$link = apply_filters('tag_feed_link', $link, $feed);
 
 	return $link;
@@ -617,7 +625,7 @@
  * @param string $feed Optional. Feed type.
  * @return string
  */
-function get_search_feed_link($search_query = '', $feed = '') {
+function get_search_feed_link($search_query = '', $feed = '', $escape = true) {
 	if ( empty($search_query) )
 		$search = esc_attr(get_search_query());
 	else
@@ -626,8 +634,10 @@
 	if ( empty($feed) )
 		$feed = get_default_feed();
 
-	$link = trailingslashit(get_option('home')) . "?s=$search&amp;feed=$feed";
-
+	$link = trailingslashit(get_option('home')) . "?s=$search&feed=$feed";
+	if($escape == true) {
+		$link = esc_url($link);
+	}
 	$link = apply_filters('search_feed_link', $link);
 
 	return $link;
@@ -642,7 +652,7 @@
  * @param string $feed Optional. Feed type.
  * @return string
  */
-function get_search_comments_feed_link($search_query = '', $feed = '') {
+function get_search_comments_feed_link($search_query = '', $feed = '', $escape = true) {
 	if ( empty($search_query) )
 		$search = esc_attr(get_search_query());
 	else
@@ -651,8 +661,10 @@
 	if ( empty($feed) )
 		$feed = get_default_feed();
 
-	$link = trailingslashit(get_option('home')) . "?s=$search&amp;feed=comments-$feed";
-
+	$link = trailingslashit(get_option('home')) . "?s=$search&feed=comments-$feed";
+	if($escape == true) {
+		$link = esc_url($link);
+	}
 	$link = apply_filters('search_feed_link', $link);
 
 	return $link;
