From 1ee98743934536a430b2683f74ca13d3f5dba077 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 3 Mar 2019 14:55:14 +0100 Subject: Fix names with spaces in letter-avatars Seems like there is a possible problem when a name containing a space is passed to this function. using urlencode on the name should fix possible problems here. Signed-off-by: Sheogorath --- lib/letter-avatars.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js index 7d463950..a5dd8207 100644 --- a/lib/letter-avatars.js +++ b/lib/letter-avatars.js @@ -30,6 +30,7 @@ exports.generateAvatarURL = function (name, email = '', big = true) { if (typeof email !== 'string') { email = '' + name + '@example.com' } + name=encodeURIComponent(name) let hash = crypto.createHash('md5') hash.update(email.toLowerCase()) -- cgit v1.2.3