Merge pull request #906 from SISheogorath/fix/letterAvatarMail

Fix possible weird objects as email
This commit is contained in:
Christoph (Sheogorath) Kern 2018-09-05 11:36:29 +01:00 committed by GitHub
commit 007f252273
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,10 @@ exports.generateAvatar = function (name) {
exports.generateAvatarURL = function (name, email = '', big = true) { exports.generateAvatarURL = function (name, email = '', big = true) {
let photo let photo
if (typeof email !== 'string') {
email = '' + name + '@example.com'
}
if (email !== '' && config.allowGravatar) { if (email !== '' && config.allowGravatar) {
photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase()) photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase())
if (big) { if (big) {