You are here

function _hosting_valid_fqdn in Hostmaster (Aegir) 6

Check if the FQDN provided is valid.

Parameters

$fqdn: The Fully Qualified Domain Name (FQDN) to validate.

Return value

An integer greater than 0 if the $fqdn is valid, or 0 or FALSE if it not valid.

5 calls to _hosting_valid_fqdn()
hosting_alias_insert in modules/hosting/alias/hosting_alias.module
Save stored aliases for a new site.
hosting_alias_nodeapi in modules/hosting/alias/hosting_alias.module
Implementation of hook_nodeapi().
hosting_server_validate in modules/hosting/server/hosting_server.module
Implementation of hook_validate().
hosting_site_validate in modules/hosting/site/hosting_site.form.inc
Implements hook_validate().
hosting_task_migrate_form_validate in modules/hosting/migrate/hosting_migrate.module
Implementation of hook_validate().

File

modules/hosting/hosting.inc, line 32
General purpose Hosting module functions.

Code

function _hosting_valid_fqdn($fqdn) {

  # regex is an implementation of RFC1035
  return preg_match("/^([a-z0-9]([a-z0-9-]*[a-z0-9])?\\.?)+\$/i", $fqdn);
}