function rate_bots_is_local in Rate 7
Check if the given IP is a local IP-address.
Parameters
string $ip:
Return value
bool
2 calls to rate_bots_is_local()
- rate_bots_is_blocked in ./
rate.bots.inc - Check if the current user is blocked.
- rate_save_vote in ./
rate.module - Save a vote to the database.
File
- ./
rate.bots.inc, line 9
Code
function rate_bots_is_local($ip) {
if (preg_match('/^([012]?[0-9]{2})\\./', $ip, $match)) {
switch ($match[1]) {
case 10:
case 127:
case 172:
case 192:
return TRUE;
}
}
return FALSE;
}