From e928a342c452b49ed84e36d3534bb9715f55845b Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Fri, 28 Dec 2012 20:10:01 -0500 Subject: Check if extra / is necessary for the folder URL --- apps/files/js/fileactions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index e1d8b60d315..533b11a6e50 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -190,7 +190,11 @@ FileActions.register('all', 'Rename', OC.PERMISSION_UPDATE, function () { FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename) { - window.location = OC.linkTo('files', 'index.php') + '?dir=' + encodeURIComponent($('#dir').val()).replace(/%2F/g, '/') + '/' + encodeURIComponent(filename); + var dir = encodeURIComponent($('#dir').val()).replace(/%2F/g, '/'); + if (dir != '/') { + dir = dir + '/'; + } + window.location = OC.linkTo('files', 'index.php') + '?dir=' + dir + encodeURIComponent(filename); }); FileActions.setDefault('dir', 'Open'); -- cgit v1.2.3