File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
lib/puppet/parser/functions Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ module Puppet::Parser::Functions
22
22
23
23
if value . is_a? ( Array )
24
24
# Numbers in Puppet are often string-encoded which is troublesome ...
25
- result = value . collect { |i | i . is_a? ( String ) ? URI . escape ( i , unsafe ) : i }
25
+ result = value . collect { |i | i . is_a? ( String ) ? URI . escape ( i ) : i }
26
26
else
27
27
result = URI . escape ( value )
28
28
end
Original file line number Diff line number Diff line change 17
17
expect ( result ) . to ( eq ( ':/?%23[]@!$&\'()*+,;=%20%22%7B%7D' ) )
18
18
end
19
19
20
+ it "should uriescape an array of strings, while not touching up nonstrings" do
21
+ teststring = ":/?#[]@!$&'()*+,;= \" {}"
22
+ expectstring = ':/?%23[]@!$&\'()*+,;=%20%22%7B%7D'
23
+ result = scope . function_uriescape ( [ [ teststring , teststring , 1 ] ] )
24
+ expect ( result ) . to ( eq ( [ expectstring , expectstring , 1 ] ) )
25
+ end
26
+
20
27
it "should do nothing if a string is already safe" do
21
28
result = scope . function_uriescape ( [ "ABCdef" ] )
22
29
expect ( result ) . to ( eq ( 'ABCdef' ) )
You can’t perform that action at this time.
0 commit comments