diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-04 19:52:17 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-04 19:52:17 -0700 |
commit | 714fea4540c96f70d044e2bd1be92b504d1f8fa3 (patch) | |
tree | d55fb5619aacde3b27032587511063014cc9fcc8 /actionpack | |
parent | 333a5659e8663049618386e3fa45248d388070fd (diff) | |
download | rails-714fea4540c96f70d044e2bd1be92b504d1f8fa3.tar.gz rails-714fea4540c96f70d044e2bd1be92b504d1f8fa3.tar.bz2 rails-714fea4540c96f70d044e2bd1be92b504d1f8fa3.zip |
deleting more crazy
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 440e0162cd..0eed3ea259 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -495,13 +495,11 @@ module ActionView end "<script type=\"#{Mime::JS}\">eval(decodeURIComponent('#{string}'))</script>".html_safe elsif encode == "hex" - email_address_encoded = '' - email_address_obfuscated.each_byte do |c| - email_address_encoded << sprintf("&#%d;", c) - end + email_address_encoded = email_address_obfuscated.unpack('C*').map {|c| + sprintf("&#%d;", c) + }.join - protocol = 'mailto:' - protocol.each_byte { |c| string << sprintf("&#%d;", c) } + string += 'mailto:'.unpack('C*').map { |c| sprintf("&#%d;", c) }.join email_address.each_byte do |c| char = c.chr |