function _hosting_valid_ip in Hostmaster (Aegir) 6
Check if a hostname provided is an ip address.
Parameters
$hostname: The hostname to check.
Return value
TRUE is the $hostname is a valid IP address, FALSE otherwise.
2 calls to _hosting_valid_ip()
- hosting_get_db_server in modules/
hosting/ db_server/ hosting_db_server.module - Find the database server.
- hosting_ip_validate in modules/
hosting/ server/ hosting.ip.inc - Validate that IP list is valid. IP utility function for hook_validate.
File
- modules/
hosting/ hosting.inc, line 19 - General purpose Hosting module functions.
Code
function _hosting_valid_ip($hostname) {
return is_string(inet_pton($hostname));
}