diff options
-rw-r--r-- | includes/utils.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/utils.php b/includes/utils.php index 79888dd..993300b 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -153,6 +153,11 @@ function match_ipv6($ip, $ip_only = true) { * otherwise. */ function match_hostname($hostname) { + // That's an IP address so it is not a valid hostname. + if (match_ipv4($hostame) || match_ipv6($hostname)) { + return false; + } + return ( // Valid characters check preg_match('/^(_?[a-z\d](-*[_a-z\d])*)(\.(_?[a-z\d](-*[_a-z\d])*))*$/i', $hostname) |