mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 07:35:05 -04:00
escape userId before setting it as HTML attribute
This commit is contained in:
parent
9408d4395f
commit
a796811558
1 changed files with 1 additions and 0 deletions
|
@ -129,6 +129,7 @@ exports.chat = (() => {
|
||||||
'Replacing with "unknown". This may be a bug or a database corruption.');
|
'Replacing with "unknown". This may be a bug or a database corruption.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
msg.userId = padutils.escapeHtml(msg.userId);
|
||||||
const authorClass = `author-${msg.userId.replace(/[^a-y0-9]/g, (c) => {
|
const authorClass = `author-${msg.userId.replace(/[^a-y0-9]/g, (c) => {
|
||||||
if (c === '.') return '-';
|
if (c === '.') return '-';
|
||||||
return `z${c.charCodeAt(0)}z`;
|
return `z${c.charCodeAt(0)}z`;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue