summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/function.rb
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-09-17 16:42:40 -0700
committerMarkus Roberts <Markus@reality.com>2010-09-22 21:11:29 -0700
commit8cd1540f82cbdf903c164bdbc2c7229e34a4178b (patch)
tree130e40b4d2696e70d1b348946c56f7a5ab213cb0 /lib/puppet/parser/ast/function.rb
parent06bf566cf71b5a690c61887dff0538922b026f64 (diff)
downloadpuppet-8cd1540f82cbdf903c164bdbc2c7229e34a4178b.tar.gz
puppet-8cd1540f82cbdf903c164bdbc2c7229e34a4178b.tar.xz
puppet-8cd1540f82cbdf903c164bdbc2c7229e34a4178b.zip
[#4692] undefined variables cause :undef to be passed to functions
The :undef symbol, which we use internally to distinguish between undefined variables and variables whose value is the empty string, is being leaked in calls to functions (e.g. "split"). This is a departure from 0.25.x behavior, where undefined variables evaluated to "". This patch restores the 0.25.x behavior.
Diffstat (limited to 'lib/puppet/parser/ast/function.rb')
-rw-r--r--lib/puppet/parser/ast/function.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/function.rb b/lib/puppet/parser/ast/function.rb
index 74023f631..80e6e6512 100644
--- a/lib/puppet/parser/ast/function.rb
+++ b/lib/puppet/parser/ast/function.rb
@@ -28,7 +28,7 @@ class Puppet::Parser::AST
end
# We don't need to evaluate the name, because it's plaintext
- args = @arguments.safeevaluate(scope)
+ args = @arguments.safeevaluate(scope).map { |x| x == :undef ? '' : x }
scope.send("function_#{@name}", args)
end