summaryrefslogtreecommitdiff
path: root/lib/uri/mailto.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-12 15:24:28 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-12 15:24:28 +0000
commit6c0aece53d6fdfc890e35125dd3721ef2ff76d89 (patch)
treef5794da3e28554449621d8cb222bb2656d3e96ef /lib/uri/mailto.rb
parent31f17f880eb2819e299458dfb1bb9e4ffbfd218c (diff)
Use URI.decode_www_form_component [Bug #10774]
`parser` refered RFC2396_Parser, but it is separated. test is contributed by Dominik Menke git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/uri/mailto.rb')
-rw-r--r--lib/uri/mailto.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index b9e98e66bb..1494c3952b 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -267,18 +267,18 @@ module URI
# # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n"
#
def to_mailtext
- to = parser.unescape(@to)
+ to = URI.decode_www_form_component(@to)
head = ''
body = ''
@headers.each do |x|
case x[0]
when 'body'
- body = parser.unescape(x[1])
+ body = URI.decode_www_form_component(x[1])
when 'to'
- to << ', ' + parser.unescape(x[1])
+ to << ', ' + URI.decode_www_form_component(x[1])
else
- head << parser.unescape(x[0]).capitalize + ': ' +
- parser.unescape(x[1]) + "\n"
+ head << URI.decode_www_form_component(x[0]).capitalize + ': ' +
+ URI.decode_www_form_component(x[1]) + "\n"
end
end