Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Mar 11, 2017
1 parent 8cfbeff commit 385df56
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helpers/CFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ public static function get_real_ip(){
array_unshift($ips, $ip); $ip = FALSE;
}
for ($i = 0; $i < count($ips); $i++) {
if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) {
if (!preg_match("/^(10|172\.16|192\.168)\./i", $ips[$i])) {
$ip = $ips[$i];
break;
}
}
}
}

return ($ip ? $ip : $_SERVER['REMOTE_ADDR']);
}

Expand Down

0 comments on commit 385df56

Please sign in to comment.