mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +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");
|
const copied_html = new DOMParser().parseFromString(paste_html, "text/html");
|
||||||
if (
|
if (
|
||||||
!copied_html
|
!copied_html
|
||||||
.querySelector("a[href='" + node.firstChild.getAttribute("href") + "']")
|
.querySelector(
|
||||||
|
"a[href='" + CSS.escape(node.firstChild.getAttribute("href")) + "']",
|
||||||
|
)
|
||||||
?.parentNode?.classList.contains("message_inline_image")
|
?.parentNode?.classList.contains("message_inline_image")
|
||||||
) {
|
) {
|
||||||
// We skip previews which have their generating link copied too, to avoid
|
// We skip previews which have their generating link copied too, to avoid
|
||||||
|
|||||||
Reference in New Issue
Block a user