From f22ab12b3799dcc36b76cb5ef43594675b131d28 Mon Sep 17 00:00:00 2001 From: Christian Weber Date: Fri, 8 Jun 2007 12:23:40 +0000 Subject: Recognize lowercase location: header as seen on car.search.ch --- url.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'url.class') diff --git a/url.class b/url.class index 4f1118b..c94f4af 100644 --- a/url.class +++ b/url.class @@ -274,7 +274,7 @@ function get($p=null, $timeout=5000) { if (preg_match('#^(HTTP\S+)\s(\d+)#', $line, $parts)) # Parse result code $url->headers[$parts[1]] = $url->result = $parts[2]; - elseif (preg_match('#^Location: (https?://[^/]*)?(/)?(.*)$#', $line, $parts) && ($parts[1] != $url->url)) # Handle redirects (supports relative and global) + elseif (preg_match('#^Location: (https?://[^/]*)?(/)?(.*)$#i', $line, $parts) && ($parts[1] != $url->url)) # Handle redirects (supports relative and global) { unset($p['url'], $p['headers']['Host']); $url->it_url($parts[1] ? $parts[1].$parts[2].$parts[3] : $url->protocol.'://'.$url->realhostname.($parts[2] ? $parts[2].$parts[3] : '/'.dirname($url->path).'/'.$parts[3])); -- cgit v1.2.3