Gravatar integration should use lower case email addresses

XMLWordPrintable

    • 5.01
    • 2

      Gravatar implementation in com.atlassian.jira.avatar.AvatarServiceImpl.GravatarUrlStrategy doesn't convert email address to lower case.

      According to http://en.gravatar.com/site/implement/hash/ it should have been lowercased.

      Haven't tested it but this patch should fix it.

      --- AvatarServiceImpl.java      Thu Jul  5 03:30:04 2012
      +++ AvatarServiceImpl2.java     Wed Jul 11 18:42:44 2012
      @@ -370,7 +370,7 @@
                   if (user != null && user.getEmailAddress() != null)
                   {
                       String email = user.getEmailAddress();
      -                String hash = MD5Util.md5Hex(email);
      +                String hash = MD5Util.md5Hex(email.toLowerCase());
      
                       URI jiraBaseUrl = URI.create(velocityRequestContextFactory.getJiraVelocityRequestContext().getCanonicalBaseUrl());
                       String gravatarBaseUrl;
      

            Assignee:
            Eric Dalgliesh
            Reporter:
            Onur C Cakmak
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: