mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): 📦 Change sanitizer from DOMPurify to xss
This commit is contained in:
parent
a430db5c30
commit
154f17ab12
7 changed files with 99 additions and 52 deletions
|
|
@ -45,6 +45,7 @@ import { config } from "~packages/config-manager";
|
|||
import type { Attachment as APIAttachment } from "~types/mastodon/attachment";
|
||||
import type { Status as APIStatus } from "~types/mastodon/status";
|
||||
import { User } from "./user";
|
||||
import { sanitizedHtmlStrip } from "@sanitization";
|
||||
|
||||
/**
|
||||
* Gives helpers to fetch notes from database in a nice format
|
||||
|
|
@ -208,7 +209,7 @@ export class Note {
|
|||
contentType: "text/html",
|
||||
visibility,
|
||||
sensitive: is_sensitive,
|
||||
spoilerText: spoiler_text,
|
||||
spoilerText: await sanitizedHtmlStrip(spoiler_text),
|
||||
uri: uri || null,
|
||||
replyId: replyId ?? null,
|
||||
quotingId: quoteId ?? null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue