From c91dab1b2c25bdf874c9c8c41208bd09ea77eecc Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 18 Apr 2013 17:50:15 -0400 Subject: [PATCH] Soft-encode separators --- js/id/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/id/util.js b/js/id/util.js index 3a9f23daa..949cac896 100644 --- a/js/id/util.js +++ b/js/id/util.js @@ -17,9 +17,10 @@ iD.util.stringQs = function(str) { }; iD.util.qsString = function(obj, noencode) { + function softEncode(s) { return s.replace('&', '%26'); } return Object.keys(obj).sort().map(function(key) { return encodeURIComponent(key) + '=' + ( - noencode ? obj[key] : encodeURIComponent(obj[key])); + noencode ? softEncode(obj[key]) : encodeURIComponent(obj[key])); }).join('&'); };