From b6050c69922282aa4ca27cc4c3e82e96a82cc8a9 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 23 Feb 2010 10:30:21 +0000 Subject: [PATCH] Don't show two ellipses in wp_widget_rss_output(). Fixes #11244 props miqrogroove git-svn-id: http://svn.automattic.com/wordpress/trunk@13328 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/default-widgets.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index bf14a8fc49..055665ae03 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -805,8 +805,15 @@ function wp_widget_rss_output( $rss, $args = array() ) { if ( empty($title) ) $title = __('Untitled'); - $desc = str_replace(array("\n", "\r"), ' ', esc_attr(strip_tags(@html_entity_decode($item->get_description(), ENT_QUOTES, get_option('blog_charset'))))); - $desc = wp_html_excerpt( $desc, 360 ) . ' […]'; + $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) ); + $desc = wp_html_excerpt( $desc, 360 ); + + // Append ellipsis. Change existing [...] to […]. + if ( '[...]' == substr( $desc, -5 ) ) + $desc = substr( $desc, 0, -5 ) . '[…]'; + elseif ( '[…]' != substr( $desc, -10 ) ) + $desc .= ' […]'; + $desc = esc_html( $desc ); if ( $show_summary ) {