Ticket #10163 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 2 years ago

HTTP request API error

Reported by: RickGC Owned by: dd32
Priority: normal Milestone: 2.9
Component: HTTP Version: 2.8
Severity: normal Keywords: has-patch tested commit
Cc:

Description

When I try to use the function 'fech_rss' with a RSS2.0 feed I get this error:

Warning: gzinflate() [function.gzinflate]: data error in xxxxxx/wp-includes/http.php on line 1787

With other formats (RSS0.92, RSS1.0, Atom, etc) there is no problem

Sample feed to play:  http://ws.audioscrobbler.com/1.0/user/Ryck/recenttracks.rss

Prior to WP2.8 there wasn't any error...

Attachments

10163.diff Download (1.8 KB) - added by dd32 3 years ago.

Change History

comment:1   dd323 years ago

  • Status changed from new to accepted

See Also: #9761

dd323 years ago

comment:2   dd323 years ago

  • Keywords has-patch needs-testing added; http, gzinflate removed

attachment 10163.diff added

  • Introduces a compatible_gzinflate() function which attempts to decode most of the odd deflated string types which servers may return.
    • PHP's inbuilt function cannot handle many servers when they return data with different headers.
  • Works with the example link provided above, Not tested with any other servers.

I tested the patch on my server and works like a charm! Thanks!

comment:4   ryan3 years ago

[11684]. Let's see how this does in trunk before bringing into the 2.8 branch.

  • Keywords tested commit added; needs-testing removed

Was getting this error while using the plugins_api().

Applied the patch on 2.8.1-beta2 and the warning dissapeared.

Works fine for me with 2.8.1.

comment:7   dd323 years ago

Works fine for me with 2.8.1.

Do you mean, That the patch works under 2.8.1 for you? Have you tested on many url's, or just not found one that fails? :)

I applied the patch to my installation, which is 2.8.1 with a couple of plugins. Before the patch, I saw the same error message as the reporter when using the LastFM plugin. However, the decompression was successful, only the error messages were annoying. Suppressing these error messages by putting an @ before gzinflate worked as well, but this seems to be a better solution.

After applying the patch, I haven't seen any error messages nor malfunctions. The only problem I found occurs with curl and open_basedir enabled, then WP doesn't follow redirects. However, that's not related to this ticket.

comment:9   dd322 years ago

I dont see this going into the 2.8 branch, And it seems to be fairing out pretty well in trunk, Shall we close as fixed for trunk?

  • Status changed from accepted to closed
  • Resolution set to fixed
  • Milestone changed from 2.8.5 to 2.9
Note: See TracTickets for help on using tickets.