summaryrefslogtreecommitdiff
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorTravis Fields <cyberious@users.noreply.github.com>2015-02-19 12:02:15 -0800
committerTravis Fields <cyberious@users.noreply.github.com>2015-02-19 12:02:15 -0800
commit647e9bcbf9fa66ac4dd4bb5f4733cabed3d08b8f (patch)
tree33bd6c3c60bd725f6e41dde5ab8e5b34cb062262 /lib/puppet/parser
parentfcd2f53908e5f4d4c3396cd56593473c3095453d (diff)
parentb693c870d20f8bf0c574b9581a92ce3842fb3c05 (diff)
downloadpuppet-stdlib-647e9bcbf9fa66ac4dd4bb5f4733cabed3d08b8f.tar.gz
puppet-stdlib-647e9bcbf9fa66ac4dd4bb5f4733cabed3d08b8f.tar.bz2
Merge pull request #413 from mhaskel/fix
Check for string before copying
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/functions/is_domain_name.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/parser/functions/is_domain_name.rb b/lib/puppet/parser/functions/is_domain_name.rb
index 24cc208..2860ded 100644
--- a/lib/puppet/parser/functions/is_domain_name.rb
+++ b/lib/puppet/parser/functions/is_domain_name.rb
@@ -13,6 +13,9 @@ Returns true if the string passed to this function is a syntactically correct do
"given #{arguments.size} for 1")
end
+ # Only allow string types
+ return false unless arguments[0].is_a?(String)
+
domain = arguments[0].dup
# 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_max_length=63
- # Only allow string types
- return false unless domain.is_a?(String)
-
# Allow ".", it is the top level domain
return true if domain == '.'