diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-11-18 17:54:00 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-11-22 16:05:51 +0100 |
commit | ec3166742b08eabcca2c6d2166070b4cee488bf7 (patch) | |
tree | d6a8a1fb25e8b39373bb7499a67d2721903c11d7 /apps | |
parent | 7ec83fc9fbb7428bde4cf0e1071704c941ac1f37 (diff) | |
download | nextcloud-server-ec3166742b08eabcca2c6d2166070b4cee488bf7.tar.gz nextcloud-server-ec3166742b08eabcca2c6d2166070b4cee488bf7.zip |
Properly join path sections
This prevents double slashes that can mess up path comparisons in some
cases.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/favoritesplugin.js | 2 | ||||
-rw-r--r-- | apps/files/js/fileactions.js | 5 | ||||
-rw-r--r-- | apps/files_external/js/app.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/js/app.js | 2 | ||||
-rw-r--r-- | apps/files_trashbin/js/app.js | 5 |
5 files changed, 5 insertions, 11 deletions
diff --git a/apps/files/js/favoritesplugin.js b/apps/files/js/favoritesplugin.js index 417a32ef804..454a505c7bd 100644 --- a/apps/files/js/favoritesplugin.js +++ b/apps/files/js/favoritesplugin.js @@ -92,7 +92,7 @@ // folder in the files app instead of opening it directly fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { OCA.Files.App.setActiveView('files', {silent: true}); - OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true); + OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true); }); fileActions.setDefault('dir', 'Open'); return fileActions; diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 32385c42478..871a2149c88 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -612,10 +612,7 @@ this.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { var dir = context.$file.attr('data-path') || context.fileList.getCurrentDirectory(); - if (dir !== '/') { - dir = dir + '/'; - } - context.fileList.changeDirectory(dir + filename); + context.fileList.changeDirectory(OC.joinPaths(dir, filename)); }); this.registerAction({ diff --git a/apps/files_external/js/app.js b/apps/files_external/js/app.js index bf853f926dc..1bff3014bd6 100644 --- a/apps/files_external/js/app.js +++ b/apps/files_external/js/app.js @@ -54,7 +54,7 @@ OCA.External.App = { // folder in the files app instead of opening it directly fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { OCA.Files.App.setActiveView('files', {silent: true}); - OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true); + OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true); }); fileActions.setDefault('dir', 'Open'); return fileActions; diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index 3168e930829..af198208de2 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -142,7 +142,7 @@ OCA.Sharing.App = { // folder in the files app instead of opening it directly fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { OCA.Files.App.setActiveView('files', {silent: true}); - OCA.Files.App.fileList.changeDirectory(context.$file.attr('data-path') + '/' + filename, true, true); + OCA.Files.App.fileList.changeDirectory(OC.joinPaths(context.$file.attr('data-path'), filename), true, true); }); fileActions.setDefault('dir', 'Open'); return fileActions; diff --git a/apps/files_trashbin/js/app.js b/apps/files_trashbin/js/app.js index 1f46f568bf2..600a8ce2b03 100644 --- a/apps/files_trashbin/js/app.js +++ b/apps/files_trashbin/js/app.js @@ -38,10 +38,7 @@ OCA.Trashbin.App = { var fileActions = new OCA.Files.FileActions(); fileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function (filename, context) { var dir = context.fileList.getCurrentDirectory(); - if (dir !== '/') { - dir = dir + '/'; - } - context.fileList.changeDirectory(dir + filename); + context.fileList.changeDirectory(OC.joinPaths(dir, filename)); }); fileActions.setDefault('dir', 'Open'); |