summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--apps/files/tests/js/filelistSpec.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 1f19c2a6258..506d423c817 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1404,7 +1404,7 @@
* @param {string} [fileId] file id
*/
_setCurrentDir: function(targetDir, changeUrl, fileId) {
- targetDir = targetDir.replace(/\\/g, '/').replace(/\.\.\//g, '');
+ targetDir = targetDir.replace(/\\/g, '/').replace(/\/\.\.\//g, '/');
var previousDir = this.getCurrentDirectory(),
baseDir = OC.basename(targetDir);
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index baf071af9bd..a9b6a1ac1c8 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1338,6 +1338,10 @@ describe('OCA.Files.FileList tests', function() {
fileList.changeDirectory('/another\\subdir/../foo\\../bar\\..\\file/..\\folder/../');
expect(fileList.getCurrentDirectory()).toEqual('/another/subdir/foo/bar/file/folder/');
});
+ it('does not convert folders with a ".." in the name', function() {
+ fileList.changeDirectory('/abc../def');
+ expect(fileList.getCurrentDirectory()).toEqual('/abc../def');
+ });
it('switches to root dir when current directory does not exist', function() {
fileList.changeDirectory('/unexist');
deferredList.reject(404);