@ -84,7 +84,7 @@
"multiparty": "4.2.2",
"@nodebb/bootswatch": "3.4.2",
"nconf": "^0.11.2",
"nodebb-plugin-composer-default": "6.5.29",
"nodebb-plugin-composer-default": "6.5.30",
"nodebb-plugin-dbsearch": "5.0.2",
"nodebb-plugin-emoji": "^3.5.0",
"nodebb-plugin-emoji-android": "2.0.5",
@ -32,7 +32,7 @@ module.exports = function (SocketTopics) {
const systemTags = (meta.config.systemTags || '').split(',');
const isPrivileged = await user.isPrivileged(socket.uid);
return isPrivileged || !systemTags.includes(data.tag);
return isPrivileged || !systemTags.includes(String(data.tag).trim());
};
SocketTopics.autocompleteTags = async function (socket, data) {
@ -159,6 +159,9 @@ User.getPrivileges = async function (uid) {
User.isPrivileged = async function (uid) {
if (!(parseInt(uid, 10) > 0)) {
return false;
}
const results = await User.getPrivileges(uid);
return results ? (results.isAdmin || results.isGlobalModerator || results.isModeratorOfAnyCategory) : false;