diff options
-rw-r--r-- | src/etc/inc/IPv6.inc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/etc/inc/IPv6.inc b/src/etc/inc/IPv6.inc index d297ed1..5b7fb06 100644 --- a/src/etc/inc/IPv6.inc +++ b/src/etc/inc/IPv6.inc @@ -557,7 +557,7 @@ class Net_IPv6 if (false !== strpos($uip, '::') ) { - list($ip1, $ip2, $ip3) = explode('::', $uip); + list($ip1, $ip2) = explode('::', $uip, 2); if ("" == $ip1) { @@ -606,13 +606,6 @@ class Net_IPv6 $uip = "0:0:0:0:0:0:0:0"; - if (isset($ip3)) { // ::::xxx - not good - if ("" == $ip3) { // :::: - $ip3 = 0; // Give back a 9th "0" - } - $uip .= ":" . $ip3; - } - } else if (-1 == $c1) { // ::xxx $fill = str_repeat('0:', max(1, 7-$c2)); @@ -899,6 +892,10 @@ class Net_IPv6 if (!empty($ipPart[0])) { $ipv6 = explode(':', $ipPart[0]); + if(8 < count($ipv6)) { + return false; + } + foreach($ipv6 as $element) { // made a validate precheck if(!preg_match('/^[0-9a-fA-F]*$/', $element)) { return false; |