Skip to content

Commit 647e9bc

Browse files
committed
Merge pull request #413 from mhaskel/fix
Check for string before copying
2 parents fcd2f53 + b693c87 commit 647e9bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/puppet/parser/functions/is_domain_name.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ module Puppet::Parser::Functions
1313
"given #{arguments.size} for 1")
1414
end
1515

16+
# Only allow string types
17+
return false unless arguments[0].is_a?(String)
18+
1619
domain = arguments[0].dup
1720

1821
# Limits (rfc1035, 3.1)
1922
domain_max_length=255
2023
label_min_length=1
2124
label_max_length=63
2225

23-
# Only allow string types
24-
return false unless domain.is_a?(String)
25-
2626
# Allow ".", it is the top level domain
2727
return true if domain == '.'
2828

0 commit comments

Comments
 (0)