Fix DOMPurify paths. Part 2.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-10-11 00:58:00 +03:00
parent d9c978e7fc
commit 7769124401

View file

@ -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');