diff options
author | Johan Sørensen <johan@johansorensen.com> | 2008-07-12 00:57:38 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-07-12 01:04:18 +0100 |
commit | 50b5c6845ed1645cf25613024ef04187385f8dcd (patch) | |
tree | 3f0b636fb08e8b826ba00950fa7d59234bd454ca /actionpack/lib/action_view | |
parent | 5e2e1ed9ffc481a91596d8c3fd9a68d7977e75ca (diff) | |
download | rails-50b5c6845ed1645cf25613024ef04187385f8dcd.tar.gz rails-50b5c6845ed1645cf25613024ef04187385f8dcd.tar.bz2 rails-50b5c6845ed1645cf25613024ef04187385f8dcd.zip |
Ensure mail_to label is obfuscated for javascript encoding. [#294 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index f6a1f271f0..e5178938fd 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -466,7 +466,7 @@ module ActionView email_address_obfuscated.gsub!(/\./, html_options.delete("replace_dot")) if html_options.has_key?("replace_dot") if encode == "javascript" - "document.write('#{content_tag("a", name || email_address, html_options.merge({ "href" => "mailto:"+email_address+extras }))}');".each_byte do |c| + "document.write('#{content_tag("a", name || email_address_obfuscated, html_options.merge({ "href" => "mailto:"+email_address+extras }))}');".each_byte do |c| string << sprintf("%%%x", c) end "<script type=\"#{Mime::JS}\">eval(unescape('#{string}'))</script>" |