is_valid_hostname now accepts also FQDNs with double dash or dot (although technically wrong as per RFC, some registrants allow them).

This commit is contained in:
antisnatchor
2015-10-25 15:06:55 +01:00
parent 5dbfe37480
commit d017bdc585

View File

@@ -14,8 +14,6 @@ module Filters
return false if has_non_printable_char?(str)
return false if str.length > 255
return false if (str =~ /^[a-zA-Z0-9][a-zA-Z0-9\-\.]*[a-zA-Z0-9]$/).nil?
return false if not (str =~ /\.\./).nil?
return false if not (str =~ /\-\-/).nil?
true
end