X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..refs/tags/wordpress-4.3:/wp-includes/feed.php diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 86385541..f40f41a6 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -545,13 +545,51 @@ function prep_atom_text_construct($data) { } } - if (strpos($data, ']]>') == false) { + if (strpos($data, ']]>') === false) { return array('html', ""); } else { return array('html', htmlspecialchars($data)); } } +/** + * Displays Site Icon in atom feeds. + * + * @since 4.3.0 + * + * @see get_site_icon_url() + */ +function atom_site_icon() { + $url = get_site_icon_url( 32 ); + if ( $url ) { + echo "$url\n"; + } +} + +/** + * Displays Site Icon in RSS2. + * + * @since 4.3.0 + */ +function rss2_site_icon() { + $rss_title = get_wp_title_rss(); + if ( empty( $rss_title ) ) { + $rss_title = get_bloginfo_rss( 'name' ); + } + + $url = get_site_icon_url( 32 ); + if ( $url ) { + echo ' + + ' . convert_chars( $url ) . ' + ' . $rss_title . ' + ' . get_bloginfo_rss( 'url' ) . ' + 32 + 32 + ' . "\n"; + } +} + /** * Display the link for the currently displayed feed in a XSS safe way. * @@ -642,6 +680,7 @@ function fetch_feed( $url ) { */ do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) ); $feed->init(); + $feed->set_output_encoding( get_option( 'blog_charset' ) ); $feed->handle_content_type(); if ( $feed->error() )