diff --git a/includes/functions.php b/includes/functions.php index 4d299314..1304d61f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -452,3 +452,8 @@ function getBridgedState() return $arrHostapdConf['BridgedEnable']; } +// Validates a host or FQDN +function validate_host($host) { + return preg_match('/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $host); +} +