Soft-encode separators

This commit is contained in:
Tom MacWright
2013-04-18 17:50:15 -04:00
parent f1604df4d0
commit c91dab1b2c

View File

@@ -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('&');
};