From 72311d9d30913269be0dbb5966c3bf5bf6b70e34 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Tue, 26 May 2009 17:51:36 -0300 Subject: [PATCH] ActionItem1041: obfuscating e-mail address (sort of) --- app/helpers/application_helper.rb | 4 ++++ app/views/profile/_person.rhtml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e6e1b93..2341670 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -878,4 +878,8 @@ module ApplicationHelper render :file => 'shared/noosfero_layout_features' end + def link_to_email(email) + javascript_tag('var array = ' + email.split('@').to_json + '; document.write("" + array.join("@") + "")') + end + end diff --git a/app/views/profile/_person.rhtml b/app/views/profile/_person.rhtml index 3c85373..002c4aa 100644 --- a/app/views/profile/_person.rhtml +++ b/app/views/profile/_person.rhtml @@ -12,7 +12,7 @@ <%= display_field(_('Address:'), profile, :address) %> <%= display_field(_('ZIP code:'), profile, :zip_code) %> <%= display_field(_('Contact phone:'), profile, :contact_phone) %> - <%= display_field(_('e-Mail:'), profile, :email) { |email| link_to email, 'mailto:'+email } %> + <%= display_field(_('e-Mail:'), profile, :email) { |email| link_to_email(email) } %> <% end %> <%= display_field(_('Location:'), profile, :location) %> -- libgit2 0.21.2