]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/feed.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / feed.php
index 8638554146cd59c65c856d096f73d803d8e5131d..f40f41a6ad79d40ec4d152ec80b6faf9a3717785 100644 (file)
@@ -545,13 +545,51 @@ function prep_atom_text_construct($data) {
                }
        }
 
                }
        }
 
-       if (strpos($data, ']]>') == false) {
+       if (strpos($data, ']]>') === false) {
                return array('html', "<![CDATA[$data]]>");
        } else {
                return array('html', htmlspecialchars($data));
        }
 }
 
                return array('html', "<![CDATA[$data]]>");
        } 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 "<icon>$url</icon>\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 '
+<image>
+       <url>' . convert_chars( $url ) . '</url>
+       <title>' . $rss_title . '</title>
+       <link>' . get_bloginfo_rss( 'url' ) . '</link>
+       <width>32</width>
+       <height>32</height>
+</image> ' . "\n";
+       }
+}
+
 /**
  * Display the link for the currently displayed feed in a XSS safe way.
  *
 /**
  * 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();
         */
        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() )
        $feed->handle_content_type();
 
        if ( $feed->error() )