aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-03-19 17:03:02 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-03-19 17:03:02 +0000
commitab9f32442318ab306df3c5282da56e50cf807d8a (patch)
tree378d180ab7df6f2793a1631d63b65f0bf02aa6b3 /actionpack
parent83fa114e51bddabbbfc7e81edb5c3c6685c0fda4 (diff)
downloadrails-ab9f32442318ab306df3c5282da56e50cf807d8a.tar.gz
rails-ab9f32442318ab306df3c5282da56e50cf807d8a.tar.bz2
rails-ab9f32442318ab306df3c5282da56e50cf807d8a.zip
Undo accidental escaping for mail_to; add regression test. Fix incorrect credit in changelog. Closes #4202.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3976 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG4
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb1
-rw-r--r--actionpack/test/template/url_helper_test.rb4
3 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index ec69d07b12..82a00d166b 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Undo accidental escaping for mail_to; add regression test. [Nicholas Seckar]
+
* Added nicer message for assert_redirected_to (closes #4294) [court3nay]
assert_redirected_to :action => 'other_host', :only_path => false
@@ -12,7 +14,7 @@
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"}>
-* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, eddiewould@paradise.net.nz]
+* Change url_for to escape the resulting URLs when called from a view. [Nicholas Seckar, coffee2code]
* Added easy support for testing file uploads with fixture_file_upload #4105 [turnip@turnipspatch.com]. Example:
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index c4c8fca98e..ae5f0c230d 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -196,7 +196,6 @@ module ActionView
# 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." # =>
# <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>
def mail_to(email_address, name = nil, html_options = {})
- name = html_escape(name) if name
html_options = html_options.stringify_keys
encode = html_options.delete("encode")
cc, bcc, subject, body = html_options.delete("cc"), html_options.delete("bcc"), html_options.delete("subject"), html_options.delete("body")
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 95b9373c7f..2c7a526315 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -193,6 +193,10 @@ class UrlHelperTest < Test::Unit::TestCase
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.")
)
end
+
+ def test_mail_to_with_img
+ assert_dom_equal %(<a href="mailto:feedback@example.com"><img src="/feedback.png" /></a>), mail_to('feedback@example.com', '<img src="/feedback.png" />')
+ end
def test_mail_to_with_hex
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")