corrected field names to exclude, remove comment

This commit is contained in:
Ulf Gebhardt 2023-07-19 14:22:04 +02:00
parent 4448ecd6fe
commit bc1015da8c
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 1 additions and 2 deletions

View File

@ -9,7 +9,6 @@ function walkRecursive(data, fields, fieldName, callback, _key?) {
if (!Array.isArray(fields)) {
throw new Error('please provide an fields array for the walkRecursive helper')
}
// console.log(_key)
const fieldDef = fields.find((f) => f.field === _key)
if (data && typeof data === 'string' && fieldDef) {
if (!fieldDef.excludes?.includes(fieldName)) data = callback(data, _key)

View File

@ -3,7 +3,7 @@ import { cleanHtml } from '../middleware/helpers/cleanHtml'
// exclamation mark separetes field names, that should not be sanitized
const fields = [
{ field: 'content', excludes: ['message'] },
{ field: 'content', excludes: ['CreateMessage', 'Message'] },
{ field: 'contentExcerpt' },
{ field: 'reasonDescription' },
{ field: 'description', excludes: ['embed'] },