diff options
author | Adrien Thebo <git@somethingsinistral.net> | 2013-07-22 13:13:13 -0700 |
---|---|---|
committer | Adrien Thebo <git@somethingsinistral.net> | 2013-07-22 13:13:13 -0700 |
commit | e8dcc691934f11172e2a3b5064a375f6b025865b (patch) | |
tree | 6a0bf65f61575edd8b8ad1ebaedc6fbd7726201b | |
parent | e0d4588bd2470109bd1eea4e597f1d205bf01b52 (diff) | |
parent | b2e23dc65bd9851dcb6ad60ffca1acbc70b617e1 (diff) |
Merge branch 'uriescape-use_default_escape_list'
This closes GH-164
-rw-r--r-- | lib/puppet/parser/functions/uriescape.rb | 3 | ||||
-rw-r--r-- | spec/unit/puppet/parser/functions/uriescape_spec.rb | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/puppet/parser/functions/uriescape.rb b/lib/puppet/parser/functions/uriescape.rb index 67b93a6..0d81de5 100644 --- a/lib/puppet/parser/functions/uriescape.rb +++ b/lib/puppet/parser/functions/uriescape.rb @@ -15,7 +15,6 @@ module Puppet::Parser::Functions value = arguments[0] klass = value.class - unsafe = ":/?#[]@!$&'()*+,;= " unless [Array, String].include?(klass) raise(Puppet::ParseError, 'uriescape(): Requires either ' + @@ -26,7 +25,7 @@ module Puppet::Parser::Functions # Numbers in Puppet are often string-encoded which is troublesome ... result = value.collect { |i| i.is_a?(String) ? URI.escape(i,unsafe) : i } else - result = URI.escape(value,unsafe) + result = URI.escape(value) end return result diff --git a/spec/unit/puppet/parser/functions/uriescape_spec.rb b/spec/unit/puppet/parser/functions/uriescape_spec.rb index 371de46..7211c88 100644 --- a/spec/unit/puppet/parser/functions/uriescape_spec.rb +++ b/spec/unit/puppet/parser/functions/uriescape_spec.rb @@ -13,8 +13,8 @@ describe "the uriescape function" do end it "should uriescape a string" do - result = scope.function_uriescape([":/?#[]@!$&'()*+,;= "]) - result.should(eq('%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D%20')) + result = scope.function_uriescape([":/?#[]@!$&'()*+,;= \"{}"]) + result.should(eq(':/?%23[]@!$&\'()*+,;=%20%22%7B%7D')) end it "should do nothing if a string is already safe" do |