diff options
Diffstat (limited to 'url.class')
-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])); |