Home » HTTP » HTTP_Client » Bug #5759
Location header not handled correctly for non-http protocols
Details
| Submitted | 2005-10-23 20:06 UTC |
|---|---|
| From | pookey at php dot net |
| Assigned | avb |
| Status | Closed |
| Package | HTTP_Client |
| PHP Version | Irrelevant |
| OS | Any |
| Roadmaps | (Not assigned) |
Comments
[2005-10-23 20:06 UTC] pookey at php dot net
Description:
------------
Location header not handled correctly for non-http
protocols. If a Location: ftp://bar.com for example is
returned by an HTTP request to http://foo.com, then
HTTP_Request assumes this is a relative redirect and will
redirect to
http://foo.com/ftp://bar.com
Problem occours at lines 620-650. I advise a
conditional error just after
if (preg_match('/^https?:\/\//i', $redirect)) {
..
} elseif
perhaps a regex matching [a-z]{3,5}:// ?
perhaps an error saying 'redirect to unsupported protocol'