mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
Don't destruct if WP_Error. Props scribu. fixes #11168
git-svn-id: http://svn.automattic.com/wordpress/trunk@12209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
039a004122
commit
47001b4c43
@ -624,8 +624,6 @@ function wp_dashboard_incoming_links_output() {
|
||||
printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
|
||||
echo '</p>';
|
||||
}
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -742,8 +740,6 @@ function wp_dashboard_secondary_output() {
|
||||
printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
|
||||
echo '</p></div>';
|
||||
}
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
} elseif ( !$rss->get_item_quantity() ) {
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
@ -932,13 +928,14 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
|
||||
// title is optional. If black, fill it if possible
|
||||
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
|
||||
$rss = fetch_feed($widget_options[$widget_id]['url']);
|
||||
if ( ! is_wp_error($rss) )
|
||||
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
|
||||
else
|
||||
if ( is_wp_error($rss) ) {
|
||||
$widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
|
||||
} else {
|
||||
$widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
}
|
||||
}
|
||||
update_option( 'dashboard_widget_options', $widget_options );
|
||||
}
|
||||
|
||||
|
@ -772,8 +772,6 @@ function wp_widget_rss_output( $rss, $args = array() ) {
|
||||
if ( is_wp_error($rss) ) {
|
||||
if ( is_admin() || current_user_can('manage_options') )
|
||||
echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -953,10 +951,11 @@ function wp_widget_rss_process( $widget_rss, $check_feed = true ) {
|
||||
$link = esc_url(strip_tags($rss->get_permalink()));
|
||||
while ( stristr($link, 'http') != $link )
|
||||
$link = substr($link, 1);
|
||||
}
|
||||
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
}
|
||||
}
|
||||
|
||||
return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user