diff --git a/wp-includes/feed-atom-comments.php b/wp-includes/feed-atom-comments.php
index ab3447d3fc..e4a39d80bd 100644
--- a/wp-includes/feed-atom-comments.php
+++ b/wp-includes/feed-atom-comments.php
@@ -27,7 +27,7 @@ echo ''
-
+
diff --git a/wp-includes/feed-rss2.php b/wp-includes/feed-rss2.php
index e97ddd5b98..538f96b727 100644
--- a/wp-includes/feed-rss2.php
+++ b/wp-includes/feed-rss2.php
@@ -34,7 +34,7 @@ echo ''; ?>
-
-
+
@@ -50,7 +50,7 @@ echo ''; ?>
]]>
-
+
diff --git a/wp-includes/feed.php b/wp-includes/feed.php
index 7bc0247033..7323b4a9f7 100644
--- a/wp-includes/feed.php
+++ b/wp-includes/feed.php
@@ -186,7 +186,17 @@ function the_excerpt_rss() {
* @uses apply_filters() Call 'the_permalink_rss' on the post permalink
*/
function the_permalink_rss() {
- echo apply_filters('the_permalink_rss', get_permalink());
+ echo esc_url( apply_filters('the_permalink_rss', get_permalink() ));
+}
+
+/**
+ * Outputs the link to the comments for the current post in an xml safe way
+ *
+ * @since 3.0.0
+ * @return none
+ */
+function comments_link_feed() {
+ echo esc_url( get_comments_link() );
}
/**