Commit 2be4fe28587669ba3d0efb129fd8fef77b695cf3

Authored by Pat Thoyts
1 parent 9e6d0710

Generate consistent gravatar hash values as per documentation.

The gravatar documentation on implementing the hash specifies that leading
and trailing whitespace must be trimmed and all characters should be forced
to lowercase.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
app/helpers/application_helper.rb
... ... @@ -3,7 +3,8 @@ module ApplicationHelper
3 3  
4 4 def gravatar_icon(user_email, size = 40)
5 5 gravatar_host = request.ssl? ? "https://secure.gravatar.com" : "http://www.gravatar.com"
6   - "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email)}?s=#{size}&d=identicon"
  6 + user_email.strip!
  7 + "#{gravatar_host}/avatar/#{Digest::MD5.hexdigest(user_email.downcase)}?s=#{size}&d=identicon"
7 8 end
8 9  
9 10 def fixed_mode?
... ...