Merge pull request #413 from mhaskel/fix
Check for string before copying
This commit is contained in:
commit
647e9bcbf9
1 changed files with 3 additions and 3 deletions
|
@ -13,6 +13,9 @@ Returns true if the string passed to this function is a syntactically correct do
|
||||||
"given #{arguments.size} for 1")
|
"given #{arguments.size} for 1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Only allow string types
|
||||||
|
return false unless arguments[0].is_a?(String)
|
||||||
|
|
||||||
domain = arguments[0].dup
|
domain = arguments[0].dup
|
||||||
|
|
||||||
# Limits (rfc1035, 3.1)
|
# Limits (rfc1035, 3.1)
|
||||||
|
@ -20,9 +23,6 @@ Returns true if the string passed to this function is a syntactically correct do
|
||||||
label_min_length=1
|
label_min_length=1
|
||||||
label_max_length=63
|
label_max_length=63
|
||||||
|
|
||||||
# Only allow string types
|
|
||||||
return false unless domain.is_a?(String)
|
|
||||||
|
|
||||||
# Allow ".", it is the top level domain
|
# Allow ".", it is the top level domain
|
||||||
return true if domain == '.'
|
return true if domain == '.'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue