diff options
author | Reid Linnemann <rlinnemann@netgate.com> | 2022-07-20 10:34:57 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2022-07-20 10:38:31 -0300 |
commit | 5eb5735d03f90419dba9b0daa5747dc4d42a27ba (patch) | |
tree | a26a922c47a84d292eff31c199fb6809213e2fa5 /net/pear-Net_IPv6/files | |
parent | x11/libxcvt: update to 0.1.2 (diff) |
net/pear-Net_IPv6: Update to version 1.3.0b4
Summary:
- Removed patches included in 1.3.0b4
- Added php 8 compat patch to correct curly brace array accessor syntax
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D35818
Diffstat (limited to 'net/pear-Net_IPv6/files')
-rw-r--r-- | net/pear-Net_IPv6/files/patch-Net_IPv6.php | 42 | ||||
-rw-r--r-- | net/pear-Net_IPv6/files/patch-fix_compress | 36 |
2 files changed, 11 insertions, 67 deletions
diff --git a/net/pear-Net_IPv6/files/patch-Net_IPv6.php b/net/pear-Net_IPv6/files/patch-Net_IPv6.php index a49822e6149f..99517ee348f6 100644 --- a/net/pear-Net_IPv6/files/patch-Net_IPv6.php +++ b/net/pear-Net_IPv6/files/patch-Net_IPv6.php @@ -1,35 +1,15 @@ ---- Net/IPv6.php.orig 2016-08-31 14:11:53 UTC +--- Net/IPv6.php.orig 2018-07-09 11:55:41 UTC +++ Net/IPv6.php -@@ -550,7 +550,7 @@ class Net_IPv6 - - if (false !== strpos($uip, '::') ) { - -- list($ip1, $ip2) = explode('::', $uip); -+ list($ip1, $ip2) = explode('::', $uip, 2); - - if ("" == $ip1) { - -@@ -601,12 +601,12 @@ class Net_IPv6 - - } else if (-1 == $c1) { // ::xxx - -- $fill = str_repeat('0:', 7-$c2); -+ $fill = str_repeat('0:', max(1, 7-$c2)); - $uip = str_replace('::', $fill, $uip); - - } else if (-1 == $c2) { // xxx:: - -- $fill = str_repeat(':0', 7-$c1); -+ $fill = str_repeat(':0', max(1, 7-$c1)); - $uip = str_replace('::', $fill, $uip); - - } else { // xxx::xxx -@@ -912,7 +912,7 @@ class Net_IPv6 - +@@ -853,10 +853,10 @@ class Net_IPv6 + return array("", $ip); } -- if (8 == $count) { -+ if (8 == $count and empty($ipPart[1])) { - - return true; +- $ip{$pos} = '_'; ++ $ip[$pos] = '_'; + $ipPart = explode('_', $ip); + +- if ($ip{$pos-1} === ":") { ++ if ($ip[$pos-1] === ":") { + $ipPart[0] .= ":"; + } diff --git a/net/pear-Net_IPv6/files/patch-fix_compress b/net/pear-Net_IPv6/files/patch-fix_compress deleted file mode 100644 index f6768602592f..000000000000 --- a/net/pear-Net_IPv6/files/patch-fix_compress +++ /dev/null @@ -1,36 +0,0 @@ -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) { - |