mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Fix DOMPurify paths. Part 2.
Thanks to xet7 !
This commit is contained in:
parent
d9c978e7fc
commit
7769124401
1 changed files with 7 additions and 1 deletions
|
|
@ -1,7 +1,13 @@
|
||||||
import { ReactiveCache } from '/imports/reactiveCache';
|
import { ReactiveCache } from '/imports/reactiveCache';
|
||||||
import escapeForRegex from 'escape-string-regexp';
|
import escapeForRegex from 'escape-string-regexp';
|
||||||
import DOMPurify from 'dompurify';
|
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');
|
CardComments = new Mongo.Collection('card_comments');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue