X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Factivitypub%2Fvideo-comments.ts;h=ce1209035fa77cc9e41df0dcf03ea85250ff76bd;hb=2890b615f31ab7d519d8be66b49ff8712df90c51;hp=6928aced3ecc0f7d83c42657405971dc5606302c;hpb=c3badc81fe3d78601fb278a7f28eeed63060d300;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/activitypub/video-comments.ts b/server/helpers/custom-validators/activitypub/video-comments.ts index 6928aced3..ce1209035 100644 --- a/server/helpers/custom-validators/activitypub/video-comments.ts +++ b/server/helpers/custom-validators/activitypub/video-comments.ts @@ -1,7 +1,6 @@ import * as validator from 'validator' import { exists, isDateValid } from '../misc' import { isActivityPubUrlValid, isBaseActivityValid } from './misc' -import * as sanitizeHtml from 'sanitize-html' function isVideoCommentCreateActivityValid (activity: any) { return isBaseActivityValid(activity, 'Create') && @@ -11,7 +10,6 @@ function isVideoCommentCreateActivityValid (activity: any) { function isVideoCommentObjectValid (comment: any) { return comment.type === 'Note' && isActivityPubUrlValid(comment.id) && - sanitizeCommentHTML(comment) && isCommentContentValid(comment.content) && isActivityPubUrlValid(comment.inReplyTo) && isDateValid(comment.published) && @@ -31,15 +29,6 @@ export { // --------------------------------------------------------------------------- -function sanitizeCommentHTML (comment: any) { - return sanitizeHtml(comment.content, { - allowedTags: [ 'b', 'i', 'em', 'span', 'a' ], - allowedAttributes: { - 'a': [ 'href' ] - } - }) -} - function isCommentContentValid (content: any) { return exists(content) && validator.isLength('' + content, { min: 1 }) }