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

Commit

Permalink
fix: escap filename with special chracters fix #139
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Sep 18, 2021
1 parent 17d2c99 commit d1dd295
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions static/files/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ app.filter("round", function () {
};
});

app.filter("escape", function () {
return window.encodeURIComponent;
});

app.filter("ratioRound", function () {
return function (n) {
Expand Down
6 changes: 3 additions & 3 deletions static/files/template/download-tree.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="content">
<div class="header">
<a ng-if="!isdownloading(node.Name)" ng-href="download/{{ node.$path }}">{{ node.Name }}</a>
<a ng-if="!isdownloading(node.Name)" ng-href="download/{{ node.$path | escape }}">{{ node.Name }}</a>
<span ng-if="isfile() && isdownloading(node.Name)">{{ node.Name }}</span>
<span ng-if="!isdownloading(node.Name)" class="controls">
<i ng-show="!confirm" ng-click="preremove()" class="red trash icon"></i>
Expand All @@ -22,9 +22,9 @@
<audio ng-if="audioPreview" controls>
<source ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
</audio>
<img ng-if="imagePreview" ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
<img ng-if="imagePreview" ng-src="{{ showPreview ? ('download/'+(node.$path | escape)) : '' }}">
<video controls autoplay ng-if="videoPreview">
<source ng-src="{{ showPreview ? ('download/'+node.$path) : '' }}">
<source ng-src="{{ showPreview ? ('download/'+(node.$path|escape)) : '' }}">
</video>
</div>
<div class="list" ng-if="isdir() && !closed()">
Expand Down

0 comments on commit d1dd295

Please sign in to comment.