Skip to content

sanitizeMessage

Overview

Sanitize a message to prevent XSS attacks.

Markup a server sends deliberately is supported through a restrictive allowlist: basic emphasis, paragraphs, lists, and links. Everything else is removed. Text that arrives entity-encoded stays encoded and therefore displays as the literal characters it stands for.

Signature

sanitizeMessage(message)

Parameters

NameTypeRequiredDescription
messagestringyesThe message to sanitize.

Returns

string

  • The sanitized message.

Source

client/lib/utils/html.js:19

Documents matching: server v3.0.0a1.post1client v3.0.0-alpha.2