From d21b2664abcb13df2967af8caa881e41b19b3b81 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 13 Sep 2009 23:00:41 +0200 Subject: Fix #2627 - regex node name could lead to invalid tag We're converting the regex to a straight name to be used as the node class name which later on will be used as tag. It was possible to generate an invalid tag name (containing leading or successive dots). Signed-off-by: Brice Figureau --- lib/puppet/parser/ast/leaf.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index d10ea62f4..2f00ea78d 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -102,9 +102,7 @@ class Puppet::Parser::AST end def to_classname - classname = @value.to_s.downcase - classname.gsub!(/[^-a-zA-Z0-9:.]/,'') if regex? - classname + to_s.downcase.gsub(/[^-a-zA-Z0-9:.]/,'').sub(/^\.+/,'') end # implementing eql? and hash so that when an HostName is stored -- cgit