mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 01:21:13 +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-spam-be-gone": "2.3.1",
|
||||||
"nodebb-plugin-web-push": "0.7.3",
|
"nodebb-plugin-web-push": "0.7.3",
|
||||||
"nodebb-rewards-essentials": "1.0.1",
|
"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-lavender": "7.1.18",
|
||||||
"nodebb-theme-peace": "2.2.39",
|
"nodebb-theme-peace": "2.2.39",
|
||||||
"nodebb-theme-persona": "14.0.16",
|
"nodebb-theme-persona": "14.0.16",
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
"chat": "Chat",
|
"chat": "Chat",
|
||||||
"chat-with": "Continue chat with %1",
|
"chat-with": "Continue chat with %1",
|
||||||
"new-chat-with": "Start new chat with %1",
|
"new-chat-with": "Start new chat with %1",
|
||||||
|
"view-remote": "View Original",
|
||||||
"flag-profile": "Flag Profile",
|
"flag-profile": "Flag Profile",
|
||||||
"profile-flagged": "Already flagged",
|
"profile-flagged": "Already flagged",
|
||||||
"follow": "Follow",
|
"follow": "Follow",
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const intFields = [
|
|||||||
|
|
||||||
module.exports = function (User) {
|
module.exports = function (User) {
|
||||||
const fieldWhitelist = [
|
const fieldWhitelist = [
|
||||||
'uid', 'username', 'userslug', 'email', 'email:confirmed', 'joindate',
|
'uid', 'username', 'userslug', 'url', 'email', 'email:confirmed', 'joindate',
|
||||||
'lastonline', 'picture', 'icon:bgColor', 'fullname', 'birthday',
|
'lastonline', 'picture', 'icon:bgColor', 'fullname', 'birthday',
|
||||||
'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation',
|
'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation',
|
||||||
'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire',
|
'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire',
|
||||||
@@ -235,6 +235,12 @@ module.exports = function (User) {
|
|||||||
user.username = validator.escape(user.username ? user.username.toString() : '');
|
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')) {
|
if (user.hasOwnProperty('email')) {
|
||||||
user.email = validator.escape(user.email ? user.email.toString() : '');
|
user.email = validator.escape(user.email ? user.email.toString() : '');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user