You are here

function _hosting_valid_ip in Hosting 7.4

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

Check if a hostname provided is an ip address.

Parameters

string $hostname: The hostname to check.

Return value

bool 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 20
General purpose Hosting module functions.

Code

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