From 6198cca6091ca172b43a910c07bd9733c2f5432a Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 8 Mar 2009 05:01:26 +0000 Subject: [PATCH] Better error handling and display in the RSS widget, props DD32, fixes #8495 git-svn-id: http://svn.automattic.com/wordpress/trunk@10742 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/widgets.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 641c191429..2a69714910 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1765,6 +1765,12 @@ function wp_widget_rss_form( $args, $inputs = null ) { $show_author = (int) $show_author; $show_date = (int) $show_date; + if ( !empty($error) ) { + $message = sprintf( __('Error in RSS Widget: %s'), $error); + echo "

$message

"; + echo "

$message

"; + } + if ( $inputs['url'] ) : ?>

@@ -1854,8 +1860,7 @@ function wp_widget_rss_process( $widget_rss, $check_feed = true ) { $error = false; $link = ''; if ( is_wp_error($rss) ) { - $url = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1); - $error = sprintf(__('Error in RSS %1$d'), $widget_number ); + $error = $rss->get_error_message(); } else { $link = clean_url(strip_tags($rss->get_permalink())); while ( stristr($link, 'http') != $link )