function _hosting_ip_validate in Hosting 7.4
Same name and namespace in other branches
- 7.3 server/hosting.ip.inc \_hosting_ip_validate()
Validate that IP list is valid. IP utility function for hook_validate.
1 call to _hosting_ip_validate()
- hosting_server_validate in server/
hosting_server.module - Implements hook_validate().
File
- server/
hosting.ip.inc, line 50 - General IP address CRUD routines.
Code
function _hosting_ip_validate($node) {
$ips = isset($node->ip_addresses) ? (array) $node->ip_addresses : array();
foreach ($ips as $id => $ip) {
if (!empty($ip) && !_hosting_valid_ip($ip)) {
form_set_error("ip_addresses][{$id}", t('Invalid IP address: %ip.', array(
'%ip' => $ip,
)));
}
}
}