diff --git a/Gemfile b/Gemfile index 5c6d31f1..e27057be 100644 --- a/Gemfile +++ b/Gemfile @@ -68,6 +68,9 @@ gem 'simple_calendar' # Markdown display gem 'redcarpet' +# email adress obfuscation +gem 'actionview-encoded_mail_to' + # Carte openstreetmap gem 'openlayers-rails' diff --git a/Gemfile.lock b/Gemfile.lock index e3b4f3a1..9c6e7bd7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -38,6 +38,8 @@ GEM activesupport (= 4.1.2) builder (~> 3.1) erubis (~> 2.7.0) + actionview-encoded_mail_to (1.0.4) + rails activemodel (4.1.2) activesupport (= 4.1.2) builder (~> 3.1) @@ -286,6 +288,7 @@ PLATFORMS ruby DEPENDENCIES + actionview-encoded_mail_to activeadmin! brakeman coffee-rails diff --git a/app/views/events/show.html.haml b/app/views/events/show.html.haml index 72533877..4343854e 100644 --- a/app/views/events/show.html.haml +++ b/app/views/events/show.html.haml @@ -44,8 +44,7 @@ = link_to @event.url, @event.url %p Contact: - = mail_to @event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT '), - @event.contact.gsub('@', ' CHEZ ').gsub('.', ' POINT ') + = mail_to @event.contact, nil, encode: :javascript, replace_at: ' CHEZ ', replace_dot: ' POINT ' - if (@event.tags && @event.tags.present?) %p.tags