diff options
author | Christian Weber | 2007-06-08 12:23:40 +0000 |
---|---|---|
committer | Christian Weber | 2007-06-08 12:23:40 +0000 |
commit | f22ab12b3799dcc36b76cb5ef43594675b131d28 (patch) | |
tree | 144c928efbeb27e8e539d9789afea5d7973750d4 | |
parent | 882cfa59a66ebf082aa496177292887fb18819a1 (diff) | |
download | itools-f22ab12b3799dcc36b76cb5ef43594675b131d28.tar.gz itools-f22ab12b3799dcc36b76cb5ef43594675b131d28.tar.bz2 itools-f22ab12b3799dcc36b76cb5ef43594675b131d28.zip |
Recognize lowercase location: header as seen on car.search.ch
-rw-r--r-- | url.class | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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])); |