From 755f2ce1ba37f2f41aba79f8677926fdd340203b Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 31 Jul 2021 10:24:34 +0200 Subject: [PATCH] more url encoding fun --- copyparty/web/browser.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 17a9b0dd..66834bdc 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1496,13 +1496,13 @@ var fileman = (function () { var vsp = vsplit(src), base = vsp[0], - ofn = vsp[1]; + ofn = uricom_dec(vsp[1])[0]; var fn = prompt('new filename:', ofn); if (!fn || fn == ofn) return toast.warn(1, 'rename aborted'); - var dst = base + fn; + var dst = base + uricom_enc(fn, false); function rename_cb() { if (this.readyState != XMLHttpRequest.DONE) @@ -1611,7 +1611,7 @@ var fileman = (function () { links = QSA('#files tbody td:nth-child(2) a'); for (var a = 0, aa = links.length; a < aa; a++) - indir.push(links[a].getAttribute('name')); + indir.push(vsplit(links[a].getAttribute('href'))[1]); for (var a = 0; a < r.clip.length; a++) { var found = false; @@ -3319,13 +3319,11 @@ var msel = (function () { item.id = links[a].getAttribute('id'); item.sel = links[a].closest('tr').classList.contains('sel'); item.vp = href.indexOf('/') !== -1 ? href : vbase + href; - item.name = href.split('/').slice(-1); r.all.push(item); if (item.sel) r.sel.push(item); - links[a].setAttribute('name', item.name); links[a].closest('tr').setAttribute('tabindex', '0'); } }; @@ -3365,13 +3363,13 @@ var msel = (function () { }; ebi('selzip').onclick = function (e) { ev(e); - var names = r.getsel(), + var sel = r.getsel(), arg = ebi('selzip').getAttribute('fmt'), frm = mknod('form'), txt = []; - for (var a = 0; a < names.length; a++) - txt.push(names[a].name); + for (var a = 0; a < sel.length; a++) + txt.push(vsplit(sel[a].vp)[1]); txt = txt.join('\n');