summaryrefslogtreecommitdiff
path: root/url.class
diff options
context:
space:
mode:
authorChristian Weber2007-06-08 12:23:40 +0000
committerChristian Weber2007-06-08 12:23:40 +0000
commitf22ab12b3799dcc36b76cb5ef43594675b131d28 (patch)
tree144c928efbeb27e8e539d9789afea5d7973750d4 /url.class
parent882cfa59a66ebf082aa496177292887fb18819a1 (diff)
downloaditools-f22ab12b3799dcc36b76cb5ef43594675b131d28.tar.gz
itools-f22ab12b3799dcc36b76cb5ef43594675b131d28.tar.bz2
itools-f22ab12b3799dcc36b76cb5ef43594675b131d28.zip
Recognize lowercase location: header as seen on car.search.ch
Diffstat (limited to 'url.class')
-rw-r--r--url.class2
1 files changed, 1 insertions, 1 deletions
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]));