diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-30 15:07:36 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-11-30 15:07:36 +0100 |
commit | fd79511d68b970b980bd65bb6537df9642f3de3e (patch) | |
tree | 0f326531ca9b692e3e8cdbd94a0b25e92d91c872 /apps/files_sharing/js | |
parent | 364dbe611d7f86b1e615d5894d11b08d531995ac (diff) | |
parent | 42091cecf9f96d8aa3fc5c2b5bda9156bae459b5 (diff) | |
download | nextcloud-server-fd79511d68b970b980bd65bb6537df9642f3de3e.tar.gz nextcloud-server-fd79511d68b970b980bd65bb6537df9642f3de3e.zip |
Merge pull request #20688 from owncloud/publiclink-getdownloadurl-webdav
Fix public link getDownloadUrl to return Webdav public link
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 9b2e2c00f60..0b78d200b94 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -148,11 +148,14 @@ OCA.Sharing.PublicApp = { if (this.fileList) { // TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests) - this.fileList.getDownloadUrl = function (filename, dir) { - if ($.isArray(filename)) { + this.fileList.getDownloadUrl = function (filename, dir, isDir) { + var path = dir || this.getCurrentDirectory(); + if (filename && !_.isArray(filename) && !isDir) { + return OC.getRootPath() + '/public.php/webdav' + OC.joinPaths(path, filename); + } + if (_.isArray(filename)) { filename = JSON.stringify(filename); } - var path = dir || FileList.getCurrentDirectory(); var params = { path: path, files: filename |