Skip to content
This repository
Browse code

Undo accidental escaping for mail_to; add regression test. Fix incorr…

…ect credit in changelog. Closes #4202.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit ab9f32442318ab306df3c5282da56e50cf807d8a 1 parent 83fa114
Nicholas Seckar authored March 19, 2006
4  actionpack/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *SVN*
2 2
 
  3
+* Undo accidental escaping for mail_to; add regression test. [Nicholas Seckar]
  4
+
3 5
 * Added nicer message for assert_redirected_to (closes #4294) [court3nay]
4 6
 
5 7
     assert_redirected_to :action => 'other_host', :only_path => false
@@ -12,7 +14,7 @@
12 14
 
13 15
     response is not a redirection to all of the options supplied (redirection is <{:only_path=>false, :host=>"other.test.host", :action=>"other_host"}>), difference: <{:only_path=>"true", :host=>"other.test.host"}>
14 16
 
15  
-* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, eddiewould@paradise.net.nz]
  17
+* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, coffee2code]
16 18
 
17 19
 * Added easy support for testing file uploads with fixture_file_upload #4105 [turnip@turnipspatch.com]. Example:
18 20
 
1  actionpack/lib/action_view/helpers/url_helper.rb
@@ -196,7 +196,6 @@ def link_to_if(condition, name, options = {}, html_options = {}, *parameters_for
196 196
       #   mail_to "me@domain.com", "My email", :cc => "ccaddress@domain.com", :bcc => "bccaddress@domain.com", :subject => "This is an example email", :body => "This is the body of the message."   # =>
197 197
       #     <a href="mailto:me@domain.com?cc="ccaddress@domain.com"&bcc="bccaddress@domain.com"&body="This%20is%20the%20body%20of%20the%20message."&subject="This%20is%20an%20example%20email">My email</a>
198 198
       def mail_to(email_address, name = nil, html_options = {})
199  
-        name = html_escape(name) if name
200 199
         html_options = html_options.stringify_keys
201 200
         encode = html_options.delete("encode")
202 201
         cc, bcc, subject, body = html_options.delete("cc"), html_options.delete("bcc"), html_options.delete("subject"), html_options.delete("body")
4  actionpack/test/template/url_helper_test.rb
@@ -193,6 +193,10 @@ def test_mail_with_options
193 193
       mail_to("me@example.com", "My email", :cc => "ccaddress@example.com", :bcc => "bccaddress@example.com", :subject => "This is an example email", :body => "This is the body of the message.")
194 194
     )
195 195
   end
  196
+  
  197
+  def test_mail_to_with_img
  198
+    assert_dom_equal %(<a href="mailto:feedback@example.com"><img src="/feedback.png" /></a>), mail_to('feedback@example.com', '<img src="/feedback.png" />')
  199
+  end
196 200
 
197 201
   def test_mail_to_with_hex
198 202
     assert_dom_equal "<a href=\"mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d\">My email</a>", mail_to("me@domain.com", "My email", :encode => "hex")

0 notes on commit ab9f324

Please sign in to comment.
Something went wrong with that request. Please try again.