mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
copy_and_paste: Fix CSS selector injection bug.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
6914d3151d
commit
2e776bf8dc
@@ -425,7 +425,9 @@ export function paste_handler_converter(paste_html) {
|
||||
const copied_html = new DOMParser().parseFromString(paste_html, "text/html");
|
||||
if (
|
||||
!copied_html
|
||||
.querySelector("a[href='" + node.firstChild.getAttribute("href") + "']")
|
||||
.querySelector(
|
||||
"a[href='" + CSS.escape(node.firstChild.getAttribute("href")) + "']",
|
||||
)
|
||||
?.parentNode?.classList.contains("message_inline_image")
|
||||
) {
|
||||
// We skip previews which have their generating link copied too, to avoid
|
||||
|
||||
Reference in New Issue
Block a user