summaryrefslogtreecommitdiff
path: root/lib/letter-avatars.js
diff options
context:
space:
mode:
authorSheogorath2019-03-03 14:55:14 +0100
committerSheogorath2019-03-03 15:46:28 +0100
commit1ee98743934536a430b2683f74ca13d3f5dba077 (patch)
tree3b01192036cc405be7377f583327467c7d80004e /lib/letter-avatars.js
parent112827423a7d281f1eda12d0b48a9445be01d9e5 (diff)
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 <sheogorath@shivering-isles.com>
Diffstat (limited to '')
-rw-r--r--lib/letter-avatars.js1
1 files changed, 1 insertions, 0 deletions
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())