cvs: php-bugs-web /include functions.inc

From: Date: Sat, 07 Aug 2004 13:53:10 +0000
Subject: cvs: php-bugs-web /include functions.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-25721@lists.php.net to get a copy of this message
jacques Sat Aug 7 09:53:10 2004 EDT Modified files: /php-bugs-web/include functions.inc Log: Don't use ip2long seeing that bugs.php.net's version of PHP 5.0.0-dev does not work like 5.0.0. http://cvs.php.net/diff.php/php-bugs-web/include/functions.inc?r1=1.128&r2=1.129&ty=u Index: php-bugs-web/include/functions.inc diff -u php-bugs-web/include/functions.inc:1.128 php-bugs-web/include/functions.inc:1.129 --- php-bugs-web/include/functions.inc:1.128 Sat Aug 7 05:29:39 2004 +++ php-bugs-web/include/functions.inc Sat Aug 7 09:53:10 2004 @@ -599,18 +599,10 @@ * 192.168.0.0/16 -- jim kill me later with my regexp pattern * below. */ - if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) { - if (version_compare(phpversion(), "5.0.0", ">=")) { - if (ip2long($ips[$i]) != false) { - $ip = $ips[$i]; - break; - } - } else { - if (ip2long($ips[$i]) != -1) { - $ip = $ips[$i]; - break; - } - } + if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i]) && + preg_match("/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/", $ips[$i])) { + $ip = $ips[$i]; + break; } } }

« previous php.mirrors (#25721) next »