Ticket #11168: 11168.diff
| File 11168.diff, 2.2 KB (added by scribu, 4 years ago) |
|---|
-
wp-includes/default-widgets.php
772 772 if ( is_wp_error($rss) ) { 773 773 if ( is_admin() || current_user_can('manage_options') ) 774 774 echo '<p>' . sprintf( __('<strong>RSS Error</strong>: %s'), $rss->get_error_message() ) . '</p>'; 775 $rss->__destruct();776 unset($rss);777 775 return; 778 776 } 779 777 … … 953 951 $link = esc_url(strip_tags($rss->get_permalink())); 954 952 while ( stristr($link, 'http') != $link ) 955 953 $link = substr($link, 1); 954 955 $rss->__destruct(); 956 unset($rss); 956 957 } 957 $rss->__destruct();958 unset($rss);959 958 } 960 959 961 960 return compact( 'title', 'url', 'link', 'items', 'error', 'show_summary', 'show_author', 'show_date' ); -
wp-admin/includes/dashboard.php
624 624 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 625 625 echo '</p>'; 626 626 } 627 $rss->__destruct();628 unset($rss);629 627 return; 630 628 } 631 629 … … 742 740 printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message()); 743 741 echo '</p></div>'; 744 742 } 745 $rss->__destruct();746 unset($rss);747 743 } elseif ( !$rss->get_item_quantity() ) { 748 744 $rss->__destruct(); 749 745 unset($rss); … … 932 928 // title is optional. If black, fill it if possible 933 929 if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) { 934 930 $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) ) { 938 932 $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 } 941 938 } 942 939 update_option( 'dashboard_widget_options', $widget_options ); 943 940 }
