fix(n8n Form Trigger Node): Sanitize HTML for formNode (#13595)

This commit is contained in:
Dana
2025-03-03 14:28:54 +01:00
committed by GitHub
parent c1fe785174
commit 20dfaa3be6
2 changed files with 120 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ import {
type IWebhookResponseData,
} from 'n8n-workflow';
import { renderForm } from './utils';
import { renderForm, sanitizeHtml } from './utils';
export const renderFormNode = async (
context: IWebhookFunctions,
@@ -42,6 +42,12 @@ export const renderFormNode = async (
) as string) || 'Submit';
}
for (const field of fields) {
if (field.fieldType === 'html') {
field.html = sanitizeHtml(field.html as string);
}
}
const appendAttribution = context.evaluateExpression(
`{{ $('${trigger?.name}').params.options?.appendAttribution === false ? false : true }}`,
) as boolean;