From fc0e31d71cd4f293fabe068355a4405285754c2c Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 27 Oct 2016 07:32:03 -0200 Subject: Import a patch to fix Net_IPv6::compress("::") Obtained from: https://github.com/phil-davis/Net_IPv6/commit/638b96a253164b65c63825c38e79812b6c5f448d Submitted by: @phil-davis --- src/etc/inc/IPv6.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/etc/inc/IPv6.inc b/src/etc/inc/IPv6.inc index 5b7fb06..912fb06 100644 --- a/src/etc/inc/IPv6.inc +++ b/src/etc/inc/IPv6.inc @@ -740,8 +740,10 @@ class Net_IPv6 } - $cip = preg_replace('/((^:)|(:$))/', '', $cip); - $cip = preg_replace('/((^:)|(:$))/', '::', $cip); + if ($cip != "::") { + $cip = preg_replace('/((^:)|(:$))/', '', $cip); + $cip = preg_replace('/((^:)|(:$))/', '::', $cip); + } if (empty($cip)) { -- cgit v1.1