Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit d1dd295

Browse files
committed
fix: escap filename with special chracters fix #139
1 parent 17d2c99 commit d1dd295

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

static/files/js/utils.js

+3
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ app.filter("round", function () {
198198
};
199199
});
200200

201+
app.filter("escape", function () {
202+
return window.encodeURIComponent;
203+
});
201204

202205
app.filter("ratioRound", function () {
203206
return function (n) {

static/files/template/download-tree.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<div class="content">
99
<div class="header">
10-
<a ng-if="!isdownloading(node.Name)" ng-href="download/{{ node.$path }}">{{ node.Name }}</a>
10+
<a ng-if="!isdownloading(node.Name)" ng-href="download/{{ node.$path | escape }}">{{ node.Name }}</a>
1111
<span ng-if="isfile() && isdownloading(node.Name)">{{ node.Name }}</span>
1212
<span ng-if="!isdownloading(node.Name)" class="controls">
1313
<i ng-show="!confirm" ng-click="preremove()" class="red trash icon"></i>
@@ -22,9 +22,9 @@
2222
<audio ng-if="audioPreview" controls>
2323
<source ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
2424
</audio>
25-
<img ng-if="imagePreview" ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
25+
<img ng-if="imagePreview" ng-src="{{ showPreview ? ('download/'+(node.$path | escape)) : '' }}">
2626
<video controls autoplay ng-if="videoPreview">
27-
<source ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
27+
<source ng-src="{{ showPreview ? ('download/'+(node.$path|escape)) : '' }}">
2828
</video>
2929
</div>
3030
<div class="list" ng-if="isdir() && !closed()">

0 commit comments

Comments
 (0)