]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
ensure we deal with encoding of paths correctly on the client
authorJohannes <johannes@cloudron.io>
Sun, 6 Nov 2016 14:22:45 +0000 (15:22 +0100)
committerJohannes <johannes@cloudron.io>
Sun, 6 Nov 2016 14:22:45 +0000 (15:22 +0100)
app/js/app.js

index f207de677c914cfae4072abffd8a15b1d57b6c4e..b26a2a6c037b86833af219b24521bd1834ca5d6a 100644 (file)
@@ -105,18 +105,18 @@ function loadDirectory(filePath) {
 }
 
 function open(entry) {
-    var path = encode(sanitize(app.path + '/' + entry.filePath));
+    var path = sanitize(app.path + '/' + entry.filePath);
 
     if (entry.isDirectory) {
         window.location.hash = path;
         return;
     }
 
-    window.open(path);
+    window.open(encode(path));
 }
 
 function up() {
-    window.location.hash = encode(sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/')));
+    window.location.hash = sanitize(app.path.split('/').slice(0, -1).filter(function (p) { return !!p; }).join('/'));
 }
 
 function upload() {