Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#16139 closed defect (bug) (wontfix)

Follow Refresh: Headers in Snoopy

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

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
16 years ago

  • Resolution → duplicate
  • Status new → closed

Should have been fixed in #10187

#2 @simsmaster
16 years ago

  • Cc info@… added
  • Resolution duplicate
  • Status closed → reopened
  • Version → 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
16 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
16 years ago

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

#5 @nacin
16 years ago

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

#6 @scribu
16 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status reopened → closed
Note: See TracTickets for help on using tickets.