Merge pull request #459 from patthoyts/pt/gravatar-fix

Generate consistent gravatar hash values as per documentation.
This commit is contained in:
Ariejan de Vroom 2012-03-01 06:03:48 -08:00
commit df6f748179

View file

@ -3,7 +3,8 @@ module ApplicationHelper
def gravatar_icon(user_email, size = 40) def gravatar_icon(user_email, size = 40)
gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com" gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email)}?s=#{size}&d=identicon" user_email.strip!
"#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
end end
def fixed_mode? def fixed_mode?