X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/3f5685912e89eb3b0534acd85aa0946b1ca2bbe3..341dfbb66f24f5145174c373267f889c31615cc5:/wp-includes/feed.php diff --git a/wp-includes/feed.php b/wp-includes/feed.php index ebd392b1..34d8652b 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -63,7 +63,8 @@ function bloginfo_rss($show = '') { * @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 @@ function get_the_content_feed($feed_type = null) { * @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 @@ 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() ); } /** @@ -194,12 +205,12 @@ function the_permalink_rss() { * * @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 @@ function comment_guid($comment_id = null) { * * @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. @@ -475,7 +486,7 @@ function prep_atom_text_construct($data) { * @since 2.5 */ function self_link() { - $host = @parse_url(get_option('home')); + $host = @parse_url(home_url()); $host = $host['host']; echo esc_url( 'http' @@ -524,7 +535,8 @@ function fetch_feed($url) { $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();