You are here

function _hosting_valid_ip in Hosting 6.2

Same name and namespace in other branches
  1. 5 hosting.module \_hosting_valid_ip()
  2. 7.4 hosting.inc \_hosting_valid_ip()
  3. 7.3 hosting.inc \_hosting_valid_ip()

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 db_server/hosting_db_server.module
Find the database server.
hosting_ip_validate in server/hosting.ip.inc
Validate that IP list is valid. IP utility function for hook_validate.

File

./hosting.inc, line 19
General purpose Hosting module functions.

Code

function _hosting_valid_ip($hostname) {
  return is_string(inet_pton($hostname));
}