From owner-svn-ports-all@freebsd.org Thu Oct 27 17:44:14 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1212BC24E68; Thu, 27 Oct 2016 17:44:14 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B99D5B66; Thu, 27 Oct 2016 17:44:13 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9RHiChU094357; Thu, 27 Oct 2016 17:44:12 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9RHiCfh094355; Thu, 27 Oct 2016 17:44:12 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201610271744.u9RHiCfh094355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Thu, 27 Oct 2016 17:44:12 +0000 (UTC) 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 X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 17:44:14 -0000 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 +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) { +