From 1d38109297184b4a7a346bc24573ba231676f797 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 30 Jun 2014 10:10:57 +0000 Subject: [PATCH] Force a separator in get_wp_title_rss() if it was inadvertently filtered out by the theme. fixes #22362. git-svn-id: https://develop.svn.wordpress.org/trunk@28921 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/feed.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php index 6674c10a5b..972e711ff8 100644 --- a/src/wp-includes/feed.php +++ b/src/wp-includes/feed.php @@ -93,13 +93,20 @@ function get_default_feed() { * * @since 2.2.0 * - * @param string $sep Optional.How to separate the title. See wp_title() for more info. + * @param string $sep Optional. How to separate the title. See wp_title() for more info. * @return string Error message on failure or blog title on success. */ -function get_wp_title_rss($sep = '»') { - $title = wp_title($sep, false); - if ( is_wp_error( $title ) ) +function get_wp_title_rss( $sep = '»' ) { + $title = wp_title( $sep, false ); + + if ( is_wp_error( $title ) ) { return $title->get_error_message(); + } + + if ( $title && $sep && ' ' !== substr( $title, 0, 1 ) ) { + $title = " $sep " . $title; + } + /** * Filter the blog title for use as the feed title. *