function domain_validate in Domain Access 7.2
Same name and namespace in other branches
- 5 domain.module \domain_validate()
- 6.2 domain.module \domain_validate()
- 7.3 domain.module \domain_validate()
Validates a domain string.
Parameters
string $subdomain: The string to check for domain validity
Return value
array List of error messages or empty array.
1 call to domain_validate()
- domain_configure_form_validate in ./
domain.admin.inc - Validate the primary domain string.
File
- ./
domain.module, line 1039 - Core module functions for the Domain Access suite.
Code
function domain_validate($subdomain) {
$error_list = array();
// Validate the domains format generically for now.
$error = domain_valid_domain($subdomain);
if (!empty($error)) {
$error_list[] = $error;
}
// Make sure domain is unique
if (!domain_unique_domain($subdomain)) {
$error_list[] = t('The domain value must be unique.');
}
return $error_list;
}