mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-10 17:42:52 +01:00
fix: expose remote url in user object
This commit is contained in:
@@ -108,7 +108,7 @@
|
||||
"nodebb-plugin-spam-be-gone": "2.3.1",
|
||||
"nodebb-plugin-web-push": "0.7.3",
|
||||
"nodebb-rewards-essentials": "1.0.1",
|
||||
"nodebb-theme-harmony": "2.0.39",
|
||||
"nodebb-theme-harmony": "2.0.40",
|
||||
"nodebb-theme-lavender": "7.1.18",
|
||||
"nodebb-theme-peace": "2.2.39",
|
||||
"nodebb-theme-persona": "14.0.16",
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
"chat": "Chat",
|
||||
"chat-with": "Continue chat with %1",
|
||||
"new-chat-with": "Start new chat with %1",
|
||||
"view-remote": "View Original",
|
||||
"flag-profile": "Flag Profile",
|
||||
"profile-flagged": "Already flagged",
|
||||
"follow": "Follow",
|
||||
|
||||
@@ -21,7 +21,7 @@ const intFields = [
|
||||
|
||||
module.exports = function (User) {
|
||||
const fieldWhitelist = [
|
||||
'uid', 'username', 'userslug', 'email', 'email:confirmed', 'joindate',
|
||||
'uid', 'username', 'userslug', 'url', 'email', 'email:confirmed', 'joindate',
|
||||
'lastonline', 'picture', 'icon:bgColor', 'fullname', 'birthday',
|
||||
'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation',
|
||||
'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire',
|
||||
@@ -235,6 +235,12 @@ module.exports = function (User) {
|
||||
user.username = validator.escape(user.username ? user.username.toString() : '');
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty('url')) {
|
||||
// works around renderOverride supplying `url` to templates
|
||||
user.remoteUrl = user.url;
|
||||
delete user.url;
|
||||
}
|
||||
|
||||
if (user.hasOwnProperty('email')) {
|
||||
user.email = validator.escape(user.email ? user.email.toString() : '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user