Make WordPress Core

Changeset 12209


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

Location:
trunk
Files:
2 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 );
  • trunk/wp-includes/default-widgets.php

    r12193 r12209  
    773773                if ( is_admin() || current_user_can('manage_options') )
    774774                        echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>';
    775                 $rss->__destruct();
    776                 unset($rss);
    777775                return;
    778776        }
     
    954952                        while ( stristr($link, 'http') != $link )
    955953                                $link = substr($link, 1);
    956                 }
    957                 $rss->__destruct();
    958                 unset($rss);
     954
     955                        $rss->__destruct();
     956                        unset($rss);
     957                }
    959958        }
    960959
Note: See TracChangeset for help on using the changeset viewer.