function services_ipauth_is_ip_range in Services IP Authentication 7
Same name and namespace in other branches
- 6 services_ipauth.module \services_ipauth_is_ip_range()
Helper function to see if the ip address represents a single address or a range.
This function does not validate the range. To validate a range use sercices_ipauth_is_valid_ip_range().
Parameters
string $ip The IP address to check.:
Return value
boolean TRUE if this string represents an IP range, FALSE otherwise.
1 string reference to 'services_ipauth_is_ip_range'
- _services_ipauth_authenticate_call in ./
services_ipauth.inc - Authenticate call.
File
- ./
services_ipauth.module, line 58 - Hook implementations and general API function for the IP Authentication module.
Code
function services_ipauth_is_ip_range($ip) {
foreach (array(
' ',
',',
'-',
'*',
) as $range_indicator) {
if (strpos($ip, $range_indicator) !== FALSE) {
return TRUE;
}
}
return FALSE;
}