mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-06-10 02:01:03 +08:00
Set comment textConent instead of innerHTML to avoid self xss (#882)
This commit is contained in:
+1
-1
@@ -72,7 +72,7 @@ export function getCommentHeight(comment, containerWidth, showComments = true) {
|
||||
span.className = "absolute text-xs px-3 line-clamp-5";
|
||||
|
||||
span.style.width = containerWidth - borders + "px";
|
||||
span.innerHTML = comment;
|
||||
span.textContent = comment;
|
||||
span.id = "temp-comment-measure";
|
||||
|
||||
document.body.appendChild(span);
|
||||
|
||||
Reference in New Issue
Block a user