From 7934ef3a1eb83ddfa74d26f4745a2f93528185fe Mon Sep 17 00:00:00 2001 From: Brook Schofield <schofield@terena.org> Date: Tue, 26 May 2015 14:05:29 +0200 Subject: [PATCH] Silence inet_pton inet_pton failure is captured later - silence so unit tests pass. --- lib/SimpleSAML/Utils/Net.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/SimpleSAML/Utils/Net.php b/lib/SimpleSAML/Utils/Net.php index 22082b79d..4cf2c83c6 100644 --- a/lib/SimpleSAML/Utils/Net.php +++ b/lib/SimpleSAML/Utils/Net.php @@ -20,7 +20,7 @@ class Net * * @author Andreas Åkre Solberg, UNINETT AS <andreas.solberg@uninett.no> * @author Olav Morken, UNINETT AS <olav.morken@uninett.no> - * @author Brook Schofield, TERENA + * @author Brook Schofield, GÉANT * @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no> */ static function ipCIDRcheck($cidr, $ip = null) @@ -38,11 +38,11 @@ class Net // Validate IPv6 with inet_pton, convert to hex with bin2hex // then store as a long with hexdec - $ip_pack = inet_pton($ip); - $net_pack = inet_pton($net); + $ip_pack = @inet_pton($ip); + $net_pack = @inet_pton($net); if ($ip_pack === false || $net_pack === false) { - // not valid IPv6 address (warning already issued) + // not valid IPv6 address (warning silenced) return false; } -- GitLab