From 4acb06923d633bba9151237b0f0a88dcf99da7e6 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 1 Jul 2016 11:10:37 +0200 Subject: Filelist change dir auto-prepend slash Prepend a slash to directories in case it was missing since many places assume that it's there. --- apps/files/js/filelist.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 690e5e70fdb..40261a9f36c 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -513,7 +513,7 @@ * Event handler for when the URL changed */ _onUrlChanged: function(e) { - if (e && e.dir) { + if (e && _.isString(e.dir)) { this.changeDirectory(e.dir, false, true); } }, @@ -1415,6 +1415,9 @@ this.setPageTitle(); } + if (targetDir.length > 0 && targetDir[0] !== '/') { + targetDir = '/' + targetDir; + } this._currentDirectory = targetDir; // legacy stuff -- cgit v1.2.3