diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 556b9551f..b944a4a00 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -561,6 +561,12 @@ module ApplicationHelper (@has_content && @has_content[name]) || false end + def gravatar_for_mail(mail, options = { }) + if Setting.gravatar_enabled? + return gravatar(mail, options) rescue nil + end + end + private def wiki_helper diff --git a/app/views/account/show.rhtml b/app/views/account/show.rhtml index 64fb8bf5f..305629a9c 100644 --- a/app/views/account/show.rhtml +++ b/app/views/account/show.rhtml @@ -2,7 +2,7 @@ <%= link_to(l(:button_edit), {:controller => 'users', :action => 'edit', :id => @user}, :class => 'icon icon-edit') if User.current.admin? %> -

<%= gravatar @user.mail unless @user.mail.empty? %> <%=h @user.name %>

+

<%= gravatar_for_mail @user.mail unless @user.mail.empty? %> <%=h @user.name %>

<%= mail_to(h(@user.mail)) unless @user.pref.hide_mail %> @@ -29,4 +29,4 @@

<%=l(:label_activity)%>

<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> -

\ No newline at end of file +

diff --git a/app/views/issues/_history.rhtml b/app/views/issues/_history.rhtml index 65b34d7c5..e65c4d4d6 100644 --- a/app/views/issues/_history.rhtml +++ b/app/views/issues/_history.rhtml @@ -4,7 +4,7 @@

<%= link_to "##{journal.indice}", :anchor => "note-#{journal.indice}" %>
<%= content_tag('a', '', :name => "note-#{journal.indice}")%> <%= format_time(journal.created_on) %> - <%= journal.user.name %>

- <%= gravatar(journal.user.mail.blank? ? "" : journal.user.mail, :size => "32") %> + <%= gravatar_for_mail(journal.user.mail.blank? ? "" : journal.user.mail, :size => "32") %>