summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/js/public.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-11-24 16:04:03 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-11-24 16:04:03 +0100
commit6ce6e27560974dd56730ce3a9b08874c49ca8be6 (patch)
tree727dcbe2ecf67c2048a4a491de602d9b17c84a1c /apps/files_sharing/js/public.js
parent9385eef31a8af99f35bcb37d32f53efda4849d3e (diff)
parent5d2e1268cd72d2a2a44136a298a675f8fe72d93d (diff)
downloadnextcloud-server-6ce6e27560974dd56730ce3a9b08874c49ca8be6.tar.gz
nextcloud-server-6ce6e27560974dd56730ce3a9b08874c49ca8be6.zip
Merge pull request #20595 from owncloud/fix-double-slashes
Avoid double slashes in URL when trying to add an remote share
Diffstat (limited to 'apps/files_sharing/js/public.js')
-rw-r--r--apps/files_sharing/js/public.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 82691129926..9b2e2c00f60 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -286,8 +286,12 @@ OCA.Sharing.PublicApp = {
_saveToOwnCloud: function (remote, token, owner, name, isProtected) {
var location = window.location.protocol + '//' + window.location.host + OC.webroot;
+
+ if(remote.substr(-1) !== '/') {
+ remote += '/'
+ };
- var url = remote + '/index.php/apps/files#' + 'remote=' + encodeURIComponent(location) // our location is the remote for the other server
+ var url = remote + 'index.php/apps/files#' + 'remote=' + encodeURIComponent(location) // our location is the remote for the other server
+ "&token=" + encodeURIComponent(token) + "&owner=" + encodeURIComponent(owner) + "&name=" + encodeURIComponent(name) + "&protected=" + isProtected;