Merge branch 'master' into feature/wireguard

This commit is contained in:
billz
2020-09-22 18:23:36 +01:00
8 changed files with 97 additions and 10 deletions

View File

@@ -477,5 +477,9 @@ function validateCidr($cidr)
return $netmask <= 128;
}
return false;
// 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);
}