From 8d4b63d3063e7a6757f75bc4d2ba2c462b774fd9 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 19 Jul 2022 11:26:31 +0200 Subject: [PATCH] system: Net_IPv6::compress() should not compress "::" to "" --- 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 ac85b218e..273495b74 100644 --- a/src/etc/inc/IPv6.inc +++ b/src/etc/inc/IPv6.inc @@ -589,8 +589,10 @@ class Net_IPv6 $cip = preg_replace('/' . $match . '/', ':', $cip, 1); } - $cip = preg_replace('/((^:)|(:$))/', '', $cip); - $cip = preg_replace('/((^:)|(:$))/', '::', $cip); + if ($cip != '::') { + $cip = preg_replace('/((^:)|(:$))/', '', $cip); + $cip = preg_replace('/((^:)|(:$))/', '::', $cip); + } if ('' != $netmask) { $cip = $cip . '/' . $netmask;