mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-09 04:36:26 +02:00
fix: #9394, fix guest handles
This commit is contained in:
@@ -53,6 +53,16 @@ module.exports = function (Posts) {
|
||||
}));
|
||||
};
|
||||
|
||||
Posts.overrideGuestHandle = function (postData, handle) {
|
||||
if (meta.config.allowGuestHandles && postData && postData.user && parseInt(postData.uid, 10) === 0 && handle) {
|
||||
postData.user.username = validator.escape(String(handle));
|
||||
if (postData.user.hasOwnProperty('fullname')) {
|
||||
postData.user.fullname = postData.user.username;
|
||||
}
|
||||
postData.user.displayname = postData.user.username;
|
||||
}
|
||||
};
|
||||
|
||||
async function checkGroupMembership(uid, groupTitleArray) {
|
||||
if (!Array.isArray(groupTitleArray) || !groupTitleArray.length) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user