PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_Client » Bug #5759

Location header not handled correctly for non-http protocols

Details

Submitted2005-10-23 20:06 UTC
Frompookey at php dot net
Assignedavb
StatusClosed
PackageHTTP_Client
PHP VersionIrrelevant
OSAny
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'