diff --git a/public/templates/register.tpl b/public/templates/register.tpl
index fdf65eb37b..2bdfb53828 100644
--- a/public/templates/register.tpl
+++ b/public/templates/register.tpl
@@ -11,9 +11,9 @@
diff --git a/src/user.js b/src/user.js
index 06f18e2431..99b3de12ae 100644
--- a/src/user.js
+++ b/src/user.js
@@ -330,15 +330,11 @@ var utils = require('./../public/src/utils.js'),
};
User.createGravatarURLFromEmail = function(email) {
- if(email) {
- var md5sum = crypto.createHash('md5');
- md5sum.update((email || '').toLowerCase());
- var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex');
- return gravatarURL;
- }
- else {
- return "http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e";
- }
+ if (!email) email = utils.generateUUID();
+ var md5sum = crypto.createHash('md5');
+ md5sum.update(email).toLowerCase().trim();
+ var gravatarURL = 'http://www.gravatar.com/avatar/' + md5sum.digest('hex');
+ return gravatarURL;
}
User.hashPassword = function(password, callback) {