mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
v0.12.5
This commit is contained in:
parent
79bbd8fe38
commit
24a2f760b7
|
@ -1,6 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
VERSION = (0, 12, 4)
|
VERSION = (0, 12, 5)
|
||||||
CODENAME = "fil\033[33med"
|
CODENAME = "fil\033[33med"
|
||||||
BUILD_DT = (2021, 7, 30)
|
BUILD_DT = (2021, 7, 30)
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ class HttpCli(object):
|
||||||
|
|
||||||
self.uparam = uparam
|
self.uparam = uparam
|
||||||
self.cookies = cookies
|
self.cookies = cookies
|
||||||
self.vpath = unquotep(vpath)
|
self.vpath = unquotep(vpath) # not query, so + means +
|
||||||
|
|
||||||
pwd = uparam.get("pw")
|
pwd = uparam.get("pw")
|
||||||
self.uname = self.asrv.iacct.get(pwd, "*")
|
self.uname = self.asrv.iacct.get(pwd, "*")
|
||||||
|
@ -1310,11 +1310,9 @@ class HttpCli(object):
|
||||||
else:
|
else:
|
||||||
fn = self.headers.get("host", "hey")
|
fn = self.headers.get("host", "hey")
|
||||||
|
|
||||||
afn = "".join(
|
safe = (string.ascii_letters + string.digits).replace("%", "")
|
||||||
[x if x in (string.ascii_letters + string.digits) else "_" for x in fn]
|
afn = "".join([x if x in safe.replace('"', "") else "_" for x in fn])
|
||||||
)
|
bascii = unicode(safe).encode("utf-8")
|
||||||
|
|
||||||
bascii = unicode(string.ascii_letters + string.digits).encode("utf-8")
|
|
||||||
ufn = fn.encode("utf-8", "xmlcharrefreplace")
|
ufn = fn.encode("utf-8", "xmlcharrefreplace")
|
||||||
if PY2:
|
if PY2:
|
||||||
ufn = [unicode(x) if x in bascii else "%{:02x}".format(ord(x)) for x in ufn]
|
ufn = [unicode(x) if x in bascii else "%{:02x}".format(ord(x)) for x in ufn]
|
||||||
|
@ -1329,6 +1327,7 @@ class HttpCli(object):
|
||||||
|
|
||||||
cdis = "attachment; filename=\"{}.{}\"; filename*=UTF-8''{}.{}"
|
cdis = "attachment; filename=\"{}.{}\"; filename*=UTF-8''{}.{}"
|
||||||
cdis = cdis.format(afn, fmt, ufn, fmt)
|
cdis = cdis.format(afn, fmt, ufn, fmt)
|
||||||
|
self.log(cdis)
|
||||||
self.send_headers(None, mime=mime, headers={"Content-Disposition": cdis})
|
self.send_headers(None, mime=mime, headers={"Content-Disposition": cdis})
|
||||||
|
|
||||||
fgen = vn.zipgen(rem, items, self.uname, dots, not self.args.no_scandir)
|
fgen = vn.zipgen(rem, items, self.uname, dots, not self.args.no_scandir)
|
||||||
|
@ -1621,6 +1620,9 @@ class HttpCli(object):
|
||||||
if not dst:
|
if not dst:
|
||||||
raise Pebkac(400, "need dst vpath")
|
raise Pebkac(400, "need dst vpath")
|
||||||
|
|
||||||
|
# x-www-form-urlencoded (url query part) uses
|
||||||
|
# either + or %20 for 0x20 so handle both
|
||||||
|
dst = unquotep(dst.replace("+", " "))
|
||||||
x = self.conn.hsrv.broker.put(
|
x = self.conn.hsrv.broker.put(
|
||||||
True, "up2k.handle_mv", self.uname, self.vpath, dst
|
True, "up2k.handle_mv", self.uname, self.vpath, dst
|
||||||
)
|
)
|
||||||
|
|
|
@ -1468,10 +1468,10 @@ var fileman = (function () {
|
||||||
if (r.clip === null)
|
if (r.clip === null)
|
||||||
r.clip = jread('fman_clip', []);
|
r.clip = jread('fman_clip', []);
|
||||||
|
|
||||||
var sel = msel.getsel();
|
var nsel = msel.getsel().length;
|
||||||
clmod(bren, 'en', sel.length == 1);
|
clmod(bren, 'en', nsel == 1);
|
||||||
clmod(bdel, 'en', sel.length);
|
clmod(bdel, 'en', nsel);
|
||||||
clmod(bcut, 'en', sel.length);
|
clmod(bcut, 'en', nsel);
|
||||||
clmod(bpst, 'en', r.clip && r.clip.length);
|
clmod(bpst, 'en', r.clip && r.clip.length);
|
||||||
bren.style.display = have_mv && has(perms, 'write') && has(perms, 'move') ? '' : 'none';
|
bren.style.display = have_mv && has(perms, 'write') && has(perms, 'move') ? '' : 'none';
|
||||||
bdel.style.display = have_del && has(perms, 'delete') ? '' : 'none';
|
bdel.style.display = have_del && has(perms, 'delete') ? '' : 'none';
|
||||||
|
@ -3367,8 +3367,13 @@ var msel = (function () {
|
||||||
ev(e);
|
ev(e);
|
||||||
var names = r.getsel(),
|
var names = r.getsel(),
|
||||||
arg = ebi('selzip').getAttribute('fmt'),
|
arg = ebi('selzip').getAttribute('fmt'),
|
||||||
txt = names.join('\n'),
|
frm = mknod('form'),
|
||||||
frm = mknod('form');
|
txt = [];
|
||||||
|
|
||||||
|
for (var a = 0; a < names.length; a++)
|
||||||
|
txt.push(names[a].name);
|
||||||
|
|
||||||
|
txt = txt.join('\n');
|
||||||
|
|
||||||
frm.setAttribute('action', '?' + arg);
|
frm.setAttribute('action', '?' + arg);
|
||||||
frm.setAttribute('method', 'post');
|
frm.setAttribute('method', 'post');
|
||||||
|
|
|
@ -44,7 +44,7 @@ avg() { awk 'function pr(ncsz) {if (nsmp>0) {printf "%3s %s\n", csz, sum/nsmp} c
|
||||||
dirs=("$HOME/vfs/ほげ" "$HOME/vfs/ほげ/ぴよ" "$HOME/vfs/$(printf \\xed\\x91)" "$HOME/vfs/$(printf \\xed\\x91/\\xed\\x92)")
|
dirs=("$HOME/vfs/ほげ" "$HOME/vfs/ほげ/ぴよ" "$HOME/vfs/$(printf \\xed\\x91)" "$HOME/vfs/$(printf \\xed\\x91/\\xed\\x92)")
|
||||||
mkdir -p "${dirs[@]}"
|
mkdir -p "${dirs[@]}"
|
||||||
for dir in "${dirs[@]}"; do for fn in ふが "$(printf \\xed\\x93)" 'qwe,rty;asd fgh+jkl%zxc&vbn <qwe>"rty'"'"'uio&asd fgh'; do echo "$dir" > "$dir/$fn.html"; done; done
|
for dir in "${dirs[@]}"; do for fn in ふが "$(printf \\xed\\x93)" 'qwe,rty;asd fgh+jkl%zxc&vbn <qwe>"rty'"'"'uio&asd fgh'; do echo "$dir" > "$dir/$fn.html"; done; done
|
||||||
|
# qw er+ty%20ui%%20op<as>df&gh&jk#zx'cv"bn`m=qw*er^ty?ui@op,as.df-gh_jk
|
||||||
|
|
||||||
##
|
##
|
||||||
## upload mojibake
|
## upload mojibake
|
||||||
|
|
Loading…
Reference in a new issue