Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#16139 closed defect (bug) (wontfix)

Follow Refresh: Headers in Snoopy

Reported by: simsmaster's profile simsmaster Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 3.0.4
Component: External Libraries Keywords: needs-patch close
Focuses: Cc:

Description

The Internet Information Server (IIS) sends back a "Refresh:0;URL" Header instead of the normal "Location:" Header.
In a plugin, I use Snoopy to fetch a page, and it does not follow a redirection via Refresh, witch brakes my plugin on IIS Servers.
I know Snoopy is deprecated, but I have some troubles with the HTTP API, so I prefer Snoopy.

Change History (6)

#1 @peaceablewhale
14 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Should have been fixed in #10187

#2 @simsmaster
14 years ago

  • Cc info@… added
  • Resolution duplicate deleted
  • Status changed from closed to reopened
  • Version set to 3.0.4

That duplicate is about the headers WP prints out. I´m talking about snoopy, while fetching a non-WP site. The bug is in Snoopy witch does not handle the redirection.

#3 @simsmaster
14 years ago

A quick fix:
Line 867 must be

if(preg_match("/^(Location:|URI:|Refresh:)/i",$currentHeader))

and line 870 must be

preg_match("/^(Location:|URI:|Refresh:[ ]+[0-9]+;[ ]*url=)[ ]*(.*)/i",chop($currentHeader),$matches);

Both in wp-include/class-snoopy.php. I´m not really good at this regex stuff, but it works for me...

#4 @nacin
14 years ago

Simple fix: Don't use Snoopy. It's deprecated.

#5 @nacin
14 years ago

  • Keywords needs-patch close added; snoopy iis refresh removed
  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

#6 @scribu
14 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.