FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18687&edit=1

ID: 18687
Updated by: alexander.merz@gmail.com
Reported By: koyama at hoge dot org
Summary: support RFC5952 compatible format
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Net_IPv6
Operating System: CentOS
Package Version: 1.2.1
PHP Version: 5.3.6
Assigned To: alexmerz
Roadmap Versions:
New Comment:

-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




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

[2011-07-26 14:09:01] alexmerz

-Assigned To:
+Assigned To: alexmerz


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

[2011-07-26 13:58:28] koyama

Uploading a patch is not working. paste here.

--- IPv6.php 2011-07-26 20:38:19.000000000 +0900
+++ IPv6.php.new 2011-07-26 20:37:46.000000000 +0900
@@ -748,6 +748,32 @@
}

// }}}
+ // {{{ recommendedFormat()
+ /**
+ * represent IPv6 address in RFC5952 format.
+ *
+ * @param String $ip a valid IPv6-adress (hex format)
+ *
+ * @return String the recommended representation of IPv6-adress
(hex format)
+ * @access public
+ * @see compress()
+ * @static
+ * @author koyama at hoge dot org
+ */
+ function recommendedFormat($ip)
+ {
+ $compressed = self::compress($ip, true);
+ // RFC5952 4.2.2
+ // The symbol "::" MUST NOT be used to shorten just one
+ // 16-bit 0 field.
+ if ((substr_count($compressed, ':') == 7) &&
+ (strpos($compressed, '::') !== false)) {
+ $compressed = str_replace('::', ':0:', $compressed);
+ }
+ return $compressed;
+ }
+
+ // }}}
// {{{ isCompressible()

/**

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

[2011-07-26 13:55:17] koyama

Description:
------------
The new RFC5952, has established a recommended text representation of
IPv6 address. The compress () output will conform to it almost a little
different.

In RFC5952 4.2.2, "The symbol "::" MUST NOT be used to shorten just one
16-bit 0 field." I wrote new method for it.

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

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 8, '11 at 10:31p
activeAug 8, '11 at 10:31p
posts1
users1
websitepear.php.net

1 user in discussion

Alexander Merz: 1 post

People

Translate

site design / logo © 2022 Grokbase