Merge pull request #20595 from owncloud/fix-double-slashes

Avoid double slashes in URL when trying to add an remote share
This commit is contained in:
Thomas Müller 2015-11-24 16:04:03 +01:00
commit 6ce6e27560
1 changed files with 5 additions and 1 deletions

View File

@ -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;