php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28187 parse_url doesn't handle embedded IPv6 addresses
Submitted: 2004-04-27 19:40 UTC Modified: 2004-04-27 21:23 UTC
From: blue at anonix dot net Assigned: pollita (profile)
Status: Closed Package: URL related
PHP Version: 4.3.4 OS: OpenBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: blue at anonix dot net
New email:
PHP Version: OS:

 

 [2004-04-27 19:40 UTC] blue at anonix dot net
Description:
------------
parse_url doesn't handle embedded IPv6 addresses (RFC 2732)

Reproduce code:
---------------
print_r(parse_url('http://[::1]/'));

Expected result:
----------------
Array
(
    [scheme] => http
    [host] => [::1]
    [path] => /
)


Actual result:
--------------
Array
(
    [scheme] => http
    [host] => [
    [path] => /
)


With a full IPv6 address like 1234:1234:1234:1234:1324:1234:1234 it doesn't even get that far: PHP Warning:  parse_url(http://[1234:1234:1234:1234:1324:1234:1234:1234]/): Unable to parse url in Command line code on line 1


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-27 21:23 UTC] pollita@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

~/cvs/php4$ sapi/cli/php -r 'print_r(parse_url("http://[::1]/"));'
Array
(
    [scheme] => http
    [host] => ::1
    [path] => /
)

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 15:01:23 2019 UTC