1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

cleaning up more crazy!

This commit is contained in:
Aaron Patterson 2010-10-04 20:00:55 -07:00
parent 714fea4540
commit 839e2f9664

View file

@ -501,10 +501,10 @@ module ActionView
string += 'mailto:'.unpack('C*').map { |c| sprintf("&#%d;", c) }.join
email_address.each_byte do |c|
string += email_address.unpack('C*').map do |c|
char = c.chr
string << (char =~ /\w/ ? sprintf("%%%x", c) : char)
end
char =~ /\w/ ? sprintf("%%%x", c) : char
end.join
content_tag "a", name || email_address_encoded.html_safe, html_options.merge("href" => "#{string}#{extras}".html_safe)
else
content_tag "a", name || email_address_obfuscated.html_safe, html_options.merge("href" => "mailto:#{email_address}#{extras}".html_safe)