Index: wp-includes/widgets.php =================================================================== --- wp-includes/widgets.php (revision 8856) +++ wp-includes/widgets.php (working copy) @@ -1039,6 +1039,15 @@ add_action('wp_head', 'wp_widget_recent_comments_style'); } +// added for title truncation of long feeds +function dot_truncate($str, $len, $dots = "...") { + if (strlen($str) > $len) { + $dotlen = strlen($dots); + return substr_replace($str, $dots, $len - $dotlen); + } + return $str; +} + // See large comment section at end of this file function wp_widget_rss($args, $widget_args = 1) { extract($args, EXTR_SKIP); @@ -1127,7 +1136,11 @@ $desc = ''; $summary = ''; if ( isset( $item['description'] ) && is_string( $item['description'] ) ) + { $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['description'], ENT_QUOTES)))); + // fix: truncate title at N chars + $desc = dot_truncate($desc, 500); + } elseif ( isset( $item['summary'] ) && is_string( $item['summary'] ) ) $desc = $summary = str_replace(array("\n", "\r"), ' ', attribute_escape(strip_tags(html_entity_decode($item['summary'], ENT_QUOTES))));