mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
uploaded_files_list: Fix id pollution.
The HTML id attribute is supposed to be globally unique; it’s not an appropriate place to store a user-controlled string, or to identify part of a component that’s rendered more than once. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
762617e23f
commit
b0653d1ea4
@@ -184,7 +184,7 @@ export function set_up_attachments(): void {
|
||||
});
|
||||
|
||||
$("#uploaded_files_table").on("click", ".remove-attachment", (e) => {
|
||||
const file_name = $(e.target).closest(".uploaded_file_row").attr("id");
|
||||
const file_name = $(e.target).closest(".uploaded_file_row").attr("data-attachment-name");
|
||||
delete_attachments(
|
||||
$(e.target).closest(".uploaded_file_row").attr("data-attachment-id")!,
|
||||
file_name!,
|
||||
|
||||
Reference in New Issue
Block a user