aboutsummaryrefslogtreecommitdiff
path: root/net/pear-Net_IPv6
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2016-10-27 09:27:44 +0000
committerRenato Botelho <garga@FreeBSD.org>2016-10-27 09:27:44 +0000
commit1430c31e19c01b5e76cdcc18446215fbda158620 (patch)
treec9756d91f6b955f330434b5e5c3baa03806a19e0 /net/pear-Net_IPv6
parentdb25b5ffd088ce1c800402b530f4625aeca72c74 (diff)
downloadports-1430c31e19c01b5e76cdcc18446215fbda158620.tar.gz
ports-1430c31e19c01b5e76cdcc18446215fbda158620.zip
Notes
Diffstat (limited to 'net/pear-Net_IPv6')
-rw-r--r--net/pear-Net_IPv6/Makefile2
-rw-r--r--net/pear-Net_IPv6/files/patch-fix_compress36
2 files changed, 37 insertions, 1 deletions
diff --git a/net/pear-Net_IPv6/Makefile b/net/pear-Net_IPv6/Makefile
index 4487c49b87ae..a0a50da83c03 100644
--- a/net/pear-Net_IPv6/Makefile
+++ b/net/pear-Net_IPv6/Makefile
@@ -3,7 +3,7 @@
PORTNAME= Net_IPv6
DISTVERSION= 1.3.0.b2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net pear
DISTNAME= ${PORTNAME}-1.3.0b2
diff --git a/net/pear-Net_IPv6/files/patch-fix_compress b/net/pear-Net_IPv6/files/patch-fix_compress
new file mode 100644
index 000000000000..f6768602592f
--- /dev/null
+++ b/net/pear-Net_IPv6/files/patch-fix_compress
@@ -0,0 +1,36 @@
+From 638b96a253164b65c63825c38e79812b6c5f448d Mon Sep 17 00:00:00 2001
+From: Phil Davis <phil.davis@inf.org>
+Date: Thu, 27 Oct 2016 13:45:38 +0930
+Subject: [PATCH] Fix compress to "::"
+
+Problem:
+```
+Net_IPv6::compress("0:0:0:0:0:0:0:0");
+```
+returns the empty string.
+
+It should return double-colon "::"
+
+The preg_replace here are over-zealous, in the "::" case, the sring
+starts and ends with ":" and so both get stripped out.
+---
+ Net/IPv6.php | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/Net/IPv6.php b/Net/IPv6.php
+index ba77472..39949d1 100644
+--- Net/IPv6.php
++++ Net/IPv6.php
+@@ -734,8 +734,10 @@ public static function compress($ip, $force = false)
+
+ }
+
+- $cip = preg_replace('/((^:)|(:$))/', '', $cip);
+- $cip = preg_replace('/((^:)|(:$))/', '::', $cip);
++ if ($cip != "::") {
++ $cip = preg_replace('/((^:)|(:$))/', '', $cip);
++ $cip = preg_replace('/((^:)|(:$))/', '::', $cip);
++ }
+
+ if ('' != $netmask) {
+