Make WordPress Core


Ignore:
Timestamp:
11/18/2009 09:52:38 PM (17 years ago)
Author:
ryan
Message:

Don't destruct if WP_Error. Props scribu. fixes #11168

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r12193 r12209  
    625625                        echo '</p>';
    626626                }
    627                 $rss->__destruct();
    628                 unset($rss);
    629627                return;
    630628        }
     
    743741                        echo '</p></div>';
    744742                }
    745                 $rss->__destruct();
    746                 unset($rss);
    747743        } elseif ( !$rss->get_item_quantity() ) {
    748744                $rss->__destruct();
     
    933929                if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
    934930                        $rss = fetch_feed($widget_options[$widget_id]['url']);
    935                         if ( ! is_wp_error($rss) )
    936                                 $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));
    937                         else
     931                        if ( is_wp_error($rss) ) {
    938932                                $widget_options[$widget_id]['title'] = htmlentities(__('Unknown Feed'));
    939                         $rss->__destruct();
    940                         unset($rss);
     933                        } else {
     934                                $widget_options[$widget_id]['title'] = htmlentities(strip_tags($rss->get_title()));     
     935                                $rss->__destruct();
     936                                unset($rss);                           
     937                        }
    941938                }
    942939                update_option( 'dashboard_widget_options', $widget_options );
Note: See TracChangeset for help on using the changeset viewer.