Check if extra / is necessary for the folder URL

This commit is contained in:
Michael Gapczynski 2012-12-28 20:10:01 -05:00 committed by Jörn Friedrich Dreyer
parent ab4ae2b952
commit e928a342c4
1 changed files with 5 additions and 1 deletions

View File

@ -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');