From 82cf6e63839324e01b97c824de86acb194c702b9 Mon Sep 17 00:00:00 2001 From: Andrew Ozz 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: https://develop.svn.wordpress.org/trunk@10742 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 )