From 0f1fc2bb5dfa1bd53308567e65125613a774387d Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Mon, 19 Oct 2026 01:15:39 +0200 Subject: [PATCH] fix: sanitise imported and synced HTML templates before the composer previews them --- components/templates/placeholder-fill-modal.tsx | 4 +++- lib/__tests__/template-utils.test.ts | 14 ++++++++++++++ lib/template-utils.ts | 15 +++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/components/templates/placeholder-fill-modal.tsx b/components/templates/placeholder-fill-modal.tsx index b274b1de1..e66ad426c 100644 --- a/components/templates/placeholder-fill-modal.tsx +++ b/components/templates/placeholder-fill-modal.tsx @@ -7,6 +7,7 @@ import { cn } from '@/lib/utils'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { substitutePlaceholders, isBuiltInPlaceholder } from '@/lib/template-utils'; +import { sanitizeEmailHtml } from '@/lib/email-sanitization'; import { useFocusTrap } from '@/hooks/use-focus-trap'; import type { EmailTemplate } from '@/lib/template-types'; @@ -94,7 +95,8 @@ export function PlaceholderFillModal({
{t('preview')}
Hi {{name}}