mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
cleanup
* remove cpr bonk (deadcode) * remove get_vpath (wasteful)
This commit is contained in:
parent
4b876dd133
commit
96acbd3593
|
@ -1206,11 +1206,6 @@ class HttpCli(object):
|
||||||
else:
|
else:
|
||||||
return self.tx_res(res_path)
|
return self.tx_res(res_path)
|
||||||
|
|
||||||
if res_path != undot(res_path):
|
|
||||||
t = "malicious user; attempted path traversal; req(%r) vp(%r) => %r"
|
|
||||||
self.log(t % (self.req, "/" + self.vpath, res_path), 1)
|
|
||||||
self.cbonk(self.conn.hsrv.gmal, self.req, "trav", "path traversal")
|
|
||||||
|
|
||||||
self.tx_404()
|
self.tx_404()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -2555,7 +2555,7 @@ var mpl = (function () {
|
||||||
ebi('np_artist').textContent = np.artist || (fns.length > 1 ? fns[0] : '');
|
ebi('np_artist').textContent = np.artist || (fns.length > 1 ? fns[0] : '');
|
||||||
ebi('np_title').textContent = np.title || '';
|
ebi('np_title').textContent = np.title || '';
|
||||||
ebi('np_dur').textContent = np['.dur'] || '';
|
ebi('np_dur').textContent = np['.dur'] || '';
|
||||||
ebi('np_url').textContent = get_vpath() + np.file.split('?')[0];
|
ebi('np_url').textContent = uricom_dec(get_evpath()) + np.file.split('?')[0];
|
||||||
if (!MOBILE && cover)
|
if (!MOBILE && cover)
|
||||||
ebi('np_img').setAttribute('src', cover);
|
ebi('np_img').setAttribute('src', cover);
|
||||||
else
|
else
|
||||||
|
@ -5972,7 +5972,8 @@ var showfile = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
r.mktree = function () {
|
r.mktree = function () {
|
||||||
var html = ['<li class="bn">' + L.tv_lst + '<br />' + linksplit(get_vpath()).join('<span>/</span>') + '</li>'];
|
var crumbs = linksplit(get_evpath()).join('<span>/</span>'),
|
||||||
|
html = ['<li class="bn">' + L.tv_lst + '<br />' + crumbs + '</li>'];
|
||||||
for (var a = 0; a < r.files.length; a++) {
|
for (var a = 0; a < r.files.length; a++) {
|
||||||
var file = r.files[a];
|
var file = r.files[a];
|
||||||
html.push('<li><a href="?doc=' +
|
html.push('<li><a href="?doc=' +
|
||||||
|
@ -7595,8 +7596,8 @@ var treectl = (function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
function reload_tree() {
|
function reload_tree() {
|
||||||
var cdir = r.nextdir || get_vpath(),
|
var cevp = get_evpath(),
|
||||||
cevp = get_evpath(),
|
cdir = r.nextdir || uricom_dec(cevp),
|
||||||
links = QSA('#treeul a+a'),
|
links = QSA('#treeul a+a'),
|
||||||
nowrap = QS('#tree.nowrap') && QS('#hovertree.on'),
|
nowrap = QS('#tree.nowrap') && QS('#hovertree.on'),
|
||||||
act = null;
|
act = null;
|
||||||
|
@ -9781,7 +9782,7 @@ function wintitle(txt, noname) {
|
||||||
if (s_name && !noname)
|
if (s_name && !noname)
|
||||||
txt = s_name + ' ' + txt;
|
txt = s_name + ' ' + txt;
|
||||||
|
|
||||||
txt += get_vpath().slice(1, -1).split('/').pop();
|
txt += uricom_dec(get_evpath()).slice(1, -1).split('/').pop();
|
||||||
|
|
||||||
document.title = txt;
|
document.title = txt;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1415,7 +1415,7 @@ function up2k_init(subtle) {
|
||||||
if (FIREFOX && good_files.length > 3000)
|
if (FIREFOX && good_files.length > 3000)
|
||||||
msg.push(L.u_ff_many + "\n\n");
|
msg.push(L.u_ff_many + "\n\n");
|
||||||
|
|
||||||
msg.push(L.u_asku.format(good_files.length, esc(get_vpath())) + '<ul>');
|
msg.push(L.u_asku.format(good_files.length, esc(uricom_dec(get_evpath()))) + '<ul>');
|
||||||
for (var a = 0, aa = Math.min(20, good_files.length); a < aa; a++)
|
for (var a = 0, aa = Math.min(20, good_files.length); a < aa; a++)
|
||||||
msg.push('<li>' + esc(good_files[a][1]) + '</li>');
|
msg.push('<li>' + esc(good_files[a][1]) + '</li>');
|
||||||
|
|
||||||
|
|
|
@ -857,11 +857,6 @@ function get_evpath() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function get_vpath() {
|
|
||||||
return uricom_dec(get_evpath());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function noq_href(el) {
|
function noq_href(el) {
|
||||||
return el.getAttribute('href').split('?')[0];
|
return el.getAttribute('href').split('?')[0];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue