mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
fix: spec
This commit is contained in:
@@ -14,6 +14,9 @@ GroupFullObject:
|
||||
userTitle:
|
||||
type: number
|
||||
description: Label text for the user badge
|
||||
userTitleEscaped:
|
||||
type: number
|
||||
description: Same as userTitle but with translation tokens escaped, used to display raw userTitle in group management
|
||||
userTitleEnabled:
|
||||
type: number
|
||||
description:
|
||||
@@ -122,6 +125,9 @@ GroupDataObject:
|
||||
userTitle:
|
||||
type: number
|
||||
description: Label text for the user badge
|
||||
userTitleEscaped:
|
||||
type: number
|
||||
description: Same as userTitle but with translation tokens escaped, used to display raw userTitle in group management
|
||||
userTitleEnabled:
|
||||
type: number
|
||||
description:
|
||||
|
||||
@@ -30,6 +30,8 @@ get:
|
||||
type: number
|
||||
userTitle:
|
||||
type: string
|
||||
userTitleEscaped:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
labelColor:
|
||||
|
||||
@@ -26,6 +26,8 @@ get:
|
||||
type: number
|
||||
userTitle:
|
||||
type: string
|
||||
userTitleEscaped:
|
||||
type: string
|
||||
icon:
|
||||
type: string
|
||||
labelColor:
|
||||
|
||||
@@ -10,7 +10,6 @@ const groups = require('../../groups');
|
||||
const meta = require('../../meta');
|
||||
const pagination = require('../../pagination');
|
||||
const events = require('../../events');
|
||||
const translator = require('../../translator');
|
||||
|
||||
const groupsController = module.exports;
|
||||
|
||||
@@ -46,7 +45,7 @@ groupsController.get = async function (req, res, next) {
|
||||
return next();
|
||||
}
|
||||
group.isOwner = true;
|
||||
group.userTitleEscaped = translator.escape(group.userTitle);
|
||||
|
||||
const groupNameData = groupNames.map(function (name) {
|
||||
return {
|
||||
encodedName: encodeURIComponent(name),
|
||||
|
||||
@@ -9,7 +9,6 @@ const user = require('../user');
|
||||
const helpers = require('./helpers');
|
||||
const pagination = require('../pagination');
|
||||
const privileges = require('../privileges');
|
||||
const translator = require('../translator');
|
||||
|
||||
const groupsController = module.exports;
|
||||
|
||||
@@ -73,7 +72,7 @@ groupsController.details = async function (req, res, next) {
|
||||
return next();
|
||||
}
|
||||
groupData.isOwner = groupData.isOwner || isAdmin || (isGlobalMod && !groupData.system);
|
||||
groupData.userTitleEscaped = translator.escape(groupData.userTitle);
|
||||
|
||||
res.render('groups/details', {
|
||||
title: '[[pages:group, ' + groupData.displayName + ']]',
|
||||
group: groupData,
|
||||
|
||||
@@ -6,6 +6,7 @@ const nconf = require('nconf');
|
||||
const db = require('../database');
|
||||
const plugins = require('../plugins');
|
||||
const utils = require('../utils');
|
||||
const translator = require('../translator');
|
||||
|
||||
const intFields = [
|
||||
'createtime', 'memberCount', 'hidden', 'system', 'private',
|
||||
@@ -101,5 +102,6 @@ function escapeGroupData(group) {
|
||||
group.displayName = validator.escape(String(group.name));
|
||||
group.description = validator.escape(String(group.description || ''));
|
||||
group.userTitle = validator.escape(String(group.userTitle || ''));
|
||||
group.userTitleEscaped = translator.escape(group.userTitle);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user