From cb0bd68404bda6c8c29add8f1c1f2a36903c1fa6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 8 May 2013 23:23:05 +0000 Subject: [PATCH] Don't append ellipsis in RSS widget if the entire content is shown. props kovshenin. fixes #21702. git-svn-id: https://develop.svn.wordpress.org/trunk@24213 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/default-widgets.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index d307ec3019..160b579f80 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -866,18 +866,18 @@ function wp_widget_rss_output( $rss, $args = array() ) { $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 ); + $excerpt = wp_html_excerpt( $desc, 360 ); // Append ellipsis. Change existing [...] to […]. - if ( '[...]' == substr( $desc, -5 ) ) - $desc = substr( $desc, 0, -5 ) . '[…]'; - elseif ( '[…]' != substr( $desc, -10 ) ) - $desc .= ' […]'; + if ( '[...]' == substr( $excerpt, -5 ) ) + $excerpt = substr( $excerpt, 0, -5 ) . '[…]'; + elseif ( '[…]' != substr( $excerpt, -10 ) && $desc != $excerpt ) + $excerpt .= ' […]'; - $desc = esc_html( $desc ); + $excerpt = esc_html( $excerpt ); if ( $show_summary ) { - $summary = "
$desc
"; + $summary = "
$excerpt
"; } else { $summary = ''; }