web/wp-includes/feed.php
changeset 194 32102edaa81b
parent 136 bde1974c263b
child 204 09a1c134465b
--- a/web/wp-includes/feed.php	Thu Sep 16 15:45:36 2010 +0000
+++ b/web/wp-includes/feed.php	Mon Nov 19 18:26:13 2012 +0100
@@ -63,7 +63,8 @@
  * @return string Default feed, or for example 'rss2', 'atom', etc.
  */
 function get_default_feed() {
-	return apply_filters('default_feed', 'rss2');
+	$default_feed = apply_filters('default_feed', 'rss2');
+	return 'rss' == $default_feed ? 'rss2' : $default_feed;
 }
 
 /**
@@ -161,7 +162,7 @@
  * @param string $feed_type The type of feed. rss2 | atom | rss | rdf
  */
 function the_content_feed($feed_type = null) {
-	echo get_the_content_feed();
+	echo get_the_content_feed($feed_type);
 }
 
 /**
@@ -186,7 +187,17 @@
  * @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() );
 }
 
 /**
@@ -194,12 +205,12 @@
  *
  * @package WordPress
  * @subpackage Feed
- * @since unknown
+ * @since 2.5.0
  *
  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
  */
 function comment_guid($comment_id = null) {
-	echo get_comment_guid($comment_id);
+	echo esc_url( get_comment_guid($comment_id) );
 }
 
 /**
@@ -207,7 +218,7 @@
  *
  * @package WordPress
  * @subpackage Feed
- * @since unknown
+ * @since 2.5.0
  *
  * @param int|object $comment_id Optional comment object or id. Defaults to global comment object.
  * @return bool|string false on failure or guid for comment on success.
@@ -413,7 +424,7 @@
 	foreach ( (array) get_post_custom() as $key => $val ) {
 		if ($key == 'enclosure') {
 			foreach ( (array) $val as $enc ) {
-				$enclosure = split("\n", $enc);
+				$enclosure = explode("\n", $enc);
 				echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
 			}
 		}
@@ -475,11 +486,10 @@
  * @since 2.5
  */
 function self_link() {
-	$host = @parse_url(get_option('home'));
+	$host = @parse_url(home_url());
 	$host = $host['host'];
 	echo esc_url(
-		'http'
-		. ( (isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '' ) . '://'
+		( is_ssl() ? 'https' : 'http' ) . '://'
 		. $host
 		. stripslashes($_SERVER['REQUEST_URI'])
 		);
@@ -524,7 +534,8 @@
 	$feed->set_feed_url($url);
 	$feed->set_cache_class('WP_Feed_Cache');
 	$feed->set_file_class('WP_SimplePie_File');
-	$feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200));
+	$feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url));
+	do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
 	$feed->init();
 	$feed->handle_content_type();