From 77691244018f3a1e44c28973b40a363bf77f99b2 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Sat, 11 Oct 2025 00:58:00 +0300 Subject: [PATCH] Fix DOMPurify paths. Part 2. Thanks to xet7 ! --- models/cardComments.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/models/cardComments.js b/models/cardComments.js index dc82b0fdd..b3c3a969e 100644 --- a/models/cardComments.js +++ b/models/cardComments.js @@ -1,7 +1,13 @@ import { ReactiveCache } from '/imports/reactiveCache'; import escapeForRegex from 'escape-string-regexp'; import DOMPurify from 'dompurify'; -import { sanitizeText } from '../client/lib/secureDOMPurify'; + +// Server-side text sanitization function +function sanitizeText(text) { + if (typeof text !== 'string') return text; + // Strip HTML tags and return only text content + return text.replace(/<[^>]*>/g, ''); +} CardComments = new Mongo.Collection('card_comments');