diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 38407e45b3..a854fd0a1b 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -149,13 +149,12 @@ helpers.getUserDataByUserSlug = function (userslug, callerUID, callback) { userData.birthday = validator.escape(String(userData.birthday || '')); userData.moderationNote = validator.escape(String(userData.moderationNote || '')); - var _userDataCoverUrl; if (userData['cover:url']) { - _userDataCoverUrl = userData['cover:url'].startsWith('http') ? userData['cover:url'] : (nconf.get('relative_path') + userData['cover:url']); + userData['cover:url'] = userData['cover:url'].startsWith('http') ? userData['cover:url'] : (nconf.get('relative_path') + userData['cover:url']); } else { - _userDataCoverUrl = require('../../coverPhoto').getDefaultProfileCover(userData.uid); + userData['cover:url'] = require('../../coverPhoto').getDefaultProfileCover(userData.uid); } - userData['cover:url'] = _userDataCoverUrl; + userData['cover:position'] = validator.escape(String(userData['cover:position'] || '50% 50%')); userData['username:disableEdit'] = !userData.isAdmin && parseInt(meta.config['username:disableEdit'], 10) === 1; userData['email:disableEdit'] = !userData.isAdmin && parseInt(meta.config['email:disableEdit'], 10) === 1;