Opened 15 years ago
Closed 15 years ago
#12045 closed defect (bug) (fixed)
Header parsing in /wp-includes/rss.php sometimes receives Array instead of String
Reported by: | wpmuguru | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | HTTP API | Keywords: | |
Focuses: | Cc: |
Description
MU Trac Ticket: http://trac.mu.wordpress.org/ticket/1102
It appears that some plugin is using the RSS parsing code in WPMU to load RSS data, and the HTTP library being used sometimes provides individual HTTP headers as an Array of elements rather than as as String. I haven't had much time to track down the error, and fixing the HTTP library is the proper fix, but the following quick repair does prevent the error for now:
/wp-includes/rss.php, ~line 577:
// find Etag, and Last-Modified foreach( (array) $resp->headers as $h) { // 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1" if (is_array($h)) { $h = implode("; ", $h); } if (strpos($h, ": ")) { list($field, $val) = explode(": ", $h, 2); }
Change History (4)
Note: See
TracTickets for help on using
tickets.
An array of headers will be returned in the event that a header is duplicated in the response.
There was a bug in 2.9 with Fopen and redirects (or proxies) which would result in multiple headers being returned which could cause this.
There's a bug i just noticed in the array returning however if there are >2 items of any of the headers in there..
The code in question here, in the RSS code, probably needs to be updated to only return a String. Some docs may need to be updated to reflect the array returning of the function as well..