From 88b7cd8e96b69d4f4898afe959e50871bdcaa445 Mon Sep 17 00:00:00 2001 From: gittihub-jpg Date: Wed, 29 Apr 2026 10:04:22 +0200 Subject: [PATCH] Update js/privatebin.js Thanks, updated this to avoid relying on `Array.isArray()` for the `FileList` case and to always set `attachment_name` to an array. Co-authored-by: Mikhail Romanov <42250412+Ribas160@users.noreply.github.com> --- js/privatebin.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index a03a5111..7a2932cd 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -5230,9 +5230,7 @@ jQuery.PrivateBin = (function($) { }; if (attachmentsData.length) { cipherMessage['attachment'] = attachmentsData; - const fileNames = AttachmentViewer.getFiles(); - if (fileNames && Array.isArray(fileNames)) { - cipherMessage['attachment_name'] = fileNames.map((fileInfo => fileInfo.name)); + cipherMessage['attachment_name'] = AttachmentViewer.getFiles()?.map((fileInfo => fileInfo.name)) ?? []; } } else if (AttachmentViewer.hasAttachment()) { // fall back to cloned part