Fixes char # in filenames links

This commit is contained in:
2020-06-08 02:25:23 +01:00
parent ad84b875e5
commit c5de5a83bb

View File

@ -50,8 +50,8 @@ if (typeof XMLHttpRequest === 'undefined') {
var dnames = _this.root.split('/'); var dnames = _this.root.split('/');
$.each(dnames, function () { $.each(dnames, function () {
var part = this; var part = this;
if (npath == null) npath = part; if (npath == null) npath = encodeURIComponent(part);
else npath = npath + '/' + part; else npath = npath + '/' + encodeURIComponent(part);
$('<button/>') $('<button/>')
.append(part) .append(part)
.click(function () { .click(function () {
@ -90,7 +90,7 @@ if (typeof XMLHttpRequest === 'undefined') {
{ {
$.each(data.SubDirectories, function () { $.each(data.SubDirectories, function () {
var item = this; var item = this;
var spath = _this.root ? _this.root + '/' + item.Name : item.Name; var spath = _this.root ? _this.root + '/' + encodeURIComponent(item.Name) : encodeURIComponent(item.Name);
$('<button/>') $('<button/>')
.append(item.Name) .append(item.Name)
.click(function () { .click(function () {
@ -110,8 +110,8 @@ if (typeof XMLHttpRequest === 'undefined') {
_this.SetItemSelected(item.Name, this.checked); _this.SetItemSelected(item.Name, this.checked);
}) })
.appendTo($td); .appendTo($td);
var furl = (_this.root) ? '/files/' + owner + '/' + _this.root + '/' + item.Name var furl = (_this.root) ? '/files/' + owner + '/' + _this.root + '/' + encodeURIComponent(item.Name)
: '/files/' + owner + '/' + item.Name; : '/files/' + owner + '/' + encodeURIComponent(item.Name);
$('<td class="filename"></td>') $('<td class="filename"></td>')
.append($('<a></a>').attr('href',furl) .append($('<a></a>').attr('href',furl)
.append(item.Name)).appendTo($tr); .append(item.Name)).appendTo($tr);