mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 03:01:08 +01:00
fix: escape navigation item fields, theme:id, category fields
This commit is contained in:
@@ -76,9 +76,12 @@ function modifyCategory(category, fields) {
|
||||
|
||||
db.parseIntFields(category, intFields, fields);
|
||||
|
||||
if (category.hasOwnProperty('name')) {
|
||||
category.name = validator.escape(String(category.name || ''));
|
||||
}
|
||||
const escapeFields = ['name', 'color', 'bgColor', 'imageClass', 'class', 'link'];
|
||||
escapeFields.forEach((field) => {
|
||||
if (category.hasOwnProperty(field)) {
|
||||
category[field] = validator.escape(String(category[field] || ''));
|
||||
}
|
||||
});
|
||||
|
||||
if (category.hasOwnProperty('icon')) {
|
||||
category.icon = category.icon || 'hidden';
|
||||
|
||||
Reference in New Issue
Block a user