diff options
author | Christoph (Sheogorath) Kern | 2018-09-05 11:36:29 +0100 |
---|---|---|
committer | GitHub | 2018-09-05 11:36:29 +0100 |
commit | 007f25227358f7ee697a2cf87364830f4569583d (patch) | |
tree | 99e66552695c1641d10464cc0a8caa4eda1e9ca3 | |
parent | 72894d1b7d816bd3c0f9197b7bf0674944f39901 (diff) | |
parent | 187401a8762371380483db26f4bd65537ae6f66c (diff) |
Merge pull request #906 from SISheogorath/fix/letterAvatarMail
Fix possible weird objects as email
Diffstat (limited to '')
-rw-r--r-- | lib/letter-avatars.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js index 53fa011a..55cf9c3a 100644 --- a/lib/letter-avatars.js +++ b/lib/letter-avatars.js @@ -27,6 +27,10 @@ exports.generateAvatar = function (name) { exports.generateAvatarURL = function (name, email = '', big = true) { let photo + if (typeof email !== 'string') { + email = '' + name + '@example.com' + } + if (email !== '' && config.allowGravatar) { photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase()) if (big) { |