Don't destruct if WP_Error. Props scribu. fixes #11168
git-svn-id: https://develop.svn.wordpress.org/trunk@12209 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
97f159fd2d
commit
161beb7f61
|
@ -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,12 +928,13 @@ 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'));
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
} 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,9 +951,10 @@ 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);
|
||||
}
|
||||
$rss->__destruct();
|
||||
unset($rss);
|
||||
}
|
||||
|
||||
return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' );
|
||||
|
|
Loading…
Reference in New Issue