summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-02-19 17:12:29 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-02-19 20:20:33 +0100
commitb7ff0d44d8859ee363f8afd620bf0182c626ddbc (patch)
treea24488e70021560ecb3611f729aa40b46460197f
parentb848062d881902cb09c3aa4aff3e8ec667d58513 (diff)
downloadnextcloud-server-b7ff0d44d8859ee363f8afd620bf0182c626ddbc.tar.gz
nextcloud-server-b7ff0d44d8859ee363f8afd620bf0182c626ddbc.zip
apply backslash fix to _setCurrentDir
-rw-r--r--apps/files/js/filelist.js1
-rw-r--r--apps/files/tests/js/filelistSpec.js6
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c5c665cee77..e5634323ef1 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1009,6 +1009,7 @@
* @param changeUrl true to also update the URL, false otherwise (default)
*/
_setCurrentDir: function(targetDir, changeUrl) {
+ targetDir = targetDir.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 59e3f8a9d4e..d44365f6351 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1221,7 +1221,7 @@ describe('OCA.Files.FileList tests', function() {
"Content-Type": "application/json"
},
JSON.stringify(data)
- ]);
+ ]);
});
it('fetches file list from server and renders it when reload() is called', function() {
fileList.reload();
@@ -1242,6 +1242,10 @@ describe('OCA.Files.FileList tests', function() {
expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir', sort: 'name', sortdirection: 'asc'});
fakeServer.respond();
});
+ it('converts backslashes to slashes when calling changeDirectory()', function() {
+ fileList.changeDirectory('/another\\subdir');
+ expect(fileList.getCurrentDirectory()).toEqual('/another/subdir');
+ });
it('switches to root dir when current directory does not exist', function() {
fakeServer.respondWith(/\/index\.php\/apps\/files\/ajax\/list.php\?dir=%2funexist/, [
404, {