function domain_validate in Domain Access 5
Same name and namespace in other branches
- 6.2 domain.module \domain_validate()
- 7.3 domain.module \domain_validate()
- 7.2 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.
2 calls to domain_validate()
- domain_create_form_validate in ./
domain_admin.inc - FormsAPI for domain_create_form()
- domain_edit_form_validate in ./
domain_admin.inc - FormsAPI for domain_edit_form()
File
- ./
domain.module, line 1532 - 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;
}