[PEAR-BUG] Bug #20423 [Csd]: URI with IPv6 or IPvFuture not parsed

[email protected] Wed, 8 Oct 2014 18:09:47 +0100 (BST)
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20423&edit=1

 ID:               20423
 Updated by:       [email protected]
 Reported By:      jan dot prachar at gmail dot com
 Summary:          URI with IPv6 or IPvFuture not parsed
 Status:           Closed
 Type:             Bug
 Package:          Net_URL2
 Package Version:  2.0.7
 PHP Version:      Irrelevant
 Assigned To:      tkli
 Roadmap Versions: 
 New Comment:

it's perhaps possible to do the "default" way only within
re-composition.

and you're perhaps right that your suggestion is more the way Net_URL2
currently behaves.

if you want, feel free to create a new ticket for this port issue.


Previous Comments:
------------------------------------------------------------------------

[2014-10-08 16:54:24] tkli

I did thought about that, too, but decided differently because in the
RFC it is written that:

URI producers and
   normalizers should omit the port component and its ":" delimiter if
   port is empty or if its value would be the same as that of the
   scheme's default.

http://tools.ietf.org/html/rfc3986#section-3.2.3

"http://example.com:"

is having the default port (represented within Net_URL2 as FALSE for
port).

"http://example.com"

is having the default port (represented within Net_URL2 as FALSE for
port).

------------------------------------------------------------------------

[2014-10-08 11:30:44] pracj3am

I looked at your fix and imho it should be distinguished between empty
and missing port like this:

$url = new Net_URL2('http://example.com:');
$this->assertSame('', $url->getPort());

$url = new Net_URL2('http://example.com');
$this->assertFalse($url->getPort());

------------------------------------------------------------------------

[2014-10-08 01:55:06] tkli

-Status: Critical
+Status: Closed
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pear.php.net/get/

------------------------------------------------------------------------

[2014-10-07 22:53:42] tkli

-Summary:     Doesn&#039;t parse URI with IPv6 or IPvFuture
+Summary:     URI with IPv6 or IPvFuture not parsed
-Status:      Open
+Status:      Critical
-Assigned To:
+Assigned To: tkli
not supporting IP-literals is a major violation of the announced support
of RFC 3986 by Net_URL2.

Net_URL2 with this flaw (<= 2.0.7) even violates the example URI  given
in section 1.1.2:

    ldap://[2001:db8::7]/c=GB?objectClass?one

similar to your report, it gets cripled to

    ldap:/c=GB?objectClass?one

this will be fixed in the next release.

------------------------------------------------------------------------

[2014-10-06 19:25:01] pracj3am

Description:
------------
Missing support for IPv6 or IPvFuture host.

Test script:
---------------
echo (new self('http://[::1]//'))->getUrl();

Expected result:
----------------
http://[::1]//

Actual result:
--------------
http://

------------------------------------------------------------------------


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20423&edit=1