]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - app/js/app.js
ensure we deal with encoding of paths correctly on the client
[perso/Immae/Projets/Nodejs/Surfer.git] / 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() {