[wp-trac] [WordPress Trac] #24646: fetch_feed() returns WP_Error with "A valid URL was not provided"

WordPress Trac noreply at wordpress.org
Thu Jun 27 01:24:08 UTC 2013


#24646: fetch_feed() returns WP_Error with "A valid URL was not provided"
--------------------------+------------------------------
 Reporter:  husdaman      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Feeds         |     Version:  3.5.2
 Severity:  major         |  Resolution:
 Keywords:  dev-feedback  |
--------------------------+------------------------------

Comment (by aaroncampbell):

 I actually can't get `fetch_feed( 'schools.hwdsb.on.ca/balaclava/feed' )`
 to work on 3.5.1 or 3.5.2.  However, `fetch_feed(
 'http://schools.hwdsb.on.ca/balaclava/feed' )` worked for me on both.  It
 looks like Simplepie calls `SimplePie_Misc::fix_protocol()` on all URLs,
 but if the URL is missing a protocol that method calls itself again
 passing http as the protocol.  On the second call the URL (in my case the
 slashes) are getting encoded causing the URL to be invalid.

 The easy fix for you right now is to pass full URL with the protocol to
 `fetch_feed()`

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


More information about the wp-trac mailing list