| 10 |
if ($addr == null) |
if ($addr == null) |
| 11 |
$addr = $_SERVER["REMOTE_ADDR"]; |
$addr = $_SERVER["REMOTE_ADDR"]; |
| 12 |
|
|
| 13 |
if ($x_addr == null && isset($_SERVER["HTTP_X_CLIENT_ADDR"])) |
if ($x_addr == null && isset($_SERVER["HTTP_X_FORWARDED_FOR"])) |
| 14 |
$x_addr = $_SERVER["HTTP_X_CLIENT_ADDR"]; |
$x_addr = $_SERVER["HTTP_X_FORWARDED_FOR"]; |
| 15 |
|
|
| 16 |
foreach($proxy_ip as $ip) |
foreach($proxy_ip as $tmp => $ip) |
| 17 |
{ |
{ |
| 18 |
if (ereg($ip,$addr)) |
if (preg_match("/".$ip."/",$addr)) |
| 19 |
{ |
{ |
| 20 |
if ($x_addr != null) |
if ($x_addr != null) |
| 21 |
{ |
{ |
| 23 |
for($i=count($client_addr)-1;$i>=0;$i--) |
for($i=count($client_addr)-1;$i>=0;$i--) |
| 24 |
{ |
{ |
| 25 |
$proxy = false; |
$proxy = false; |
| 26 |
foreach($proxy_ip as $ip) |
foreach($proxy_ip as $tmp => $ip) |
| 27 |
{ |
{ |
| 28 |
if (ereg($ip,$client_addr[$i])) |
if (preg_match("/".$ip."/",$client_addr[$i])) |
| 29 |
$proxy = true; |
$proxy = true; |
| 30 |
} |
} |
| 31 |
if (!$proxy) |
if (!$proxy) |