From 07483033c1b52efd269a0b1eb8df1d3eb2ad8a2b Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Tue, 19 May 2015 15:12:08 +0200
Subject: [PATCH] Fix URL generation

`params` in the `OC.generateUrl` function call only replaces all specified occurences of a key just like the l10n PHP functionality does.

This means that to build a query string we have to use `OC.buildQueryString` instead of the params parameters.

Fixes https://github.com/owncloud/core/issues/16336 which is a regression introduced with https://github.com/owncloud/core/commit/58a87d0babcb91aab75b45e630d2fc2fee15691e of https://github.com/owncloud/core/pull/15652.

Without this fix downloading single files from a public shared folder is not possible.
---
 apps/files_sharing/js/public.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js
index 79bd0bb0c47..73b76b6bafc 100644
--- a/apps/files_sharing/js/public.js
+++ b/apps/files_sharing/js/public.js
@@ -144,7 +144,7 @@ OCA.Sharing.PublicApp = {
 					path: path,
 					files: filename
 				};
-				return OC.generateUrl('/s/' + token + '/download', params);
+				return OC.generateUrl('/s/' + token + '/download') + '?' + OC.buildQueryString(params);
 			};
 
 			this.fileList.getAjaxUrl = function (action, params) {
-- 
GitLab