[wp-trac] [WordPress Trac] #17756: class-feed.php file_get_contents error

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 13 17:26:21 UTC 2011


#17756: class-feed.php file_get_contents error
--------------------------+------------------------------
 Reporter:  kmfj1         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Cache         |     Version:  3.2
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------

Comment (by kmfj1):

 It looks like this can be traced back to /wp-admin/includes/dashboard.php,
 which is sent an empty $url. Line 791
 wp_dashboard_incoming_links_output($url) uses an empty $url: $rss =
 fetch_feed( $url ). Also, fetch_feed($url) in /wp-includes/feed.php
 doesn't catch the error, and uses SimplePie to fetch the feed on an empty
 $url.

 SimplePie also doesn't catch the error.

 The initial call to wp_dashboard_incoming_links_output($url) is from /wp-
 admin/index-extra.php.

 So, I am not sure how best to handle this as far as strings? I am a
 longtime PHP programmer but a relative Wordpress Newbie.

 A simple change to fetch_feed($url) might resolve this, though I am not
 sure how best to handle the error output new WP_Error('simplepie-error',
 'No Feed Input');

 Begin with:
         require_once (ABSPATH . WPINC . '/class-feed.php');

         $feed = new SimplePie();

         if(empty($url)){
                 return new WP_Error('simplepie-error', 'No Feed Input');
         }

         $feed->set_feed_url($url);

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17756#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list