copy_and_paste: Fix HTML injection bug in construct_copy_div.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-04-02 17:50:19 -07:00
committed by Tim Abbott
parent 25ff0d4418
commit e1029b59ed

View File

@@ -90,7 +90,11 @@ function construct_copy_div($div, start_id, end_id) {
}
const message = message_lists.current.get(rows.id($row));
const $content = $(message.content);
$content.first().prepend(message.sender_full_name + ": ");
$content.first().prepend(
$("<span>")
.text(message.sender_full_name + ": ")
.contents(),
);
$div.append($content);
}