From 4698afdaeb422b39479a20900c0bbdbb9587684e Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 3 Jan 2020 16:35:50 -0500 Subject: [PATCH] fix: truncate pictureUrl if too long (#1311) --- server/models/users.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/models/users.js b/server/models/users.js index d25f537f..4f123cbf 100644 --- a/server/models/users.js +++ b/server/models/users.js @@ -204,7 +204,10 @@ module.exports = class User extends Model { } // Parse picture URL - let pictureUrl = _.get(profile, 'picture', _.get(user, 'pictureUrl', null)) + let pictureUrl = _.truncate(_.get(profile, 'picture', _.get(user, 'pictureUrl', null)), { + length: 255, + omission: '' + }) // Update existing user if (user) {