Date: Thu, 27 Oct 2016 17:44:12 +0000 (UTC) From: Renato Botelho <garga@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r424781 - in branches/2016Q4/net/pear-Net_IPv6: . files Message-ID: <201610271744.u9RHiCfh094355@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: garga Date: Thu Oct 27 17:44:12 2016 New Revision: 424781 URL: https://svnweb.freebsd.org/changeset/ports/424781 Log: MFH: r424752 Import a patch to fix compress("::") calls Submitted by: Phil Davis Obtained from: https://github.com/phil-davis/Net_IPv6/commit/638b96a253164b65c63825c38e79812b6c5f448d Sponsored by: Rubicon Communications (Netgate) Approved by: ports-secteam (feld) Added: branches/2016Q4/net/pear-Net_IPv6/files/patch-fix_compress - copied unchanged from r424752, head/net/pear-Net_IPv6/files/patch-fix_compress Modified: branches/2016Q4/net/pear-Net_IPv6/Makefile Directory Properties: branches/2016Q4/ (props changed) Modified: branches/2016Q4/net/pear-Net_IPv6/Makefile ============================================================================== --- branches/2016Q4/net/pear-Net_IPv6/Makefile Thu Oct 27 17:32:50 2016 (r424780) +++ branches/2016Q4/net/pear-Net_IPv6/Makefile Thu Oct 27 17:44:12 2016 (r424781) @@ -3,7 +3,7 @@ PORTNAME= Net_IPv6 DISTVERSION= 1.3.0.b2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net pear DISTNAME= ${PORTNAME}-1.3.0b2 Copied: branches/2016Q4/net/pear-Net_IPv6/files/patch-fix_compress (from r424752, head/net/pear-Net_IPv6/files/patch-fix_compress) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ branches/2016Q4/net/pear-Net_IPv6/files/patch-fix_compress Thu Oct 27 17:44:12 2016 (r424781, copy of r424752, head/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) { +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610271744.u9RHiCfh094355>