mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
gritter: Treat strings as text, not HTML
This forces users to use jQuery or DOM objects if they want formatting, which helps avoid XSS vulnerabilities.
This commit is contained in:
parent
8463134125
commit
a712ce457d
2 changed files with 9 additions and 4 deletions
|
@ -193,7 +193,10 @@ var chat = (function()
|
|||
|
||||
if(!chatOpen && ctx.duration > 0) {
|
||||
$.gritter.add({
|
||||
text: '<span class="author-name">' + ctx.authorName + '</span>' + ctx.text,
|
||||
// Note: ctx.authorName and ctx.text are already HTML-escaped.
|
||||
text: $('<p>')
|
||||
.append($('<span>').addClass('author-name').html(ctx.authorName))
|
||||
.append(ctx.text),
|
||||
sticky: ctx.sticky,
|
||||
time: 5000,
|
||||
position: 'bottom',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue