--- fenglin/lib/client_addr.inc.php 2005/03/12 08:29:35 1.7 +++ fenglin/lib/client_addr.inc.php 2005/03/23 17:31:14 1.8 @@ -13,9 +13,9 @@ function Client_Address($addr=null,$x_ad if ($x_addr == null && isset($_SERVER["HTTP_X_FORWARDED_FOR"])) $x_addr = $_SERVER["HTTP_X_FORWARDED_FOR"]; - foreach($proxy_ip as $ip) + foreach($proxy_ip as $tmp => $ip) { - if (ereg($ip[0],$addr)) + if (ereg($ip,$addr)) { if ($x_addr != null) { @@ -23,9 +23,9 @@ function Client_Address($addr=null,$x_ad for($i=count($client_addr)-1;$i>=0;$i--) { $proxy = false; - foreach($proxy_ip as $ip) + foreach($proxy_ip as $tmp => $ip) { - if (ereg($ip[0],$client_addr[$i])) + if (ereg($ip,$client_addr[$i])) $proxy = true; } if (!$proxy)