mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 17:23:02 +00:00
@@ -41,7 +41,11 @@ iD.util.stringQs = function(str) {
|
||||
};
|
||||
|
||||
iD.util.qsString = function(obj, noencode) {
|
||||
function softEncode(s) { return s.replace('&', '%26').replace('=', '%3D'); }
|
||||
function softEncode(s) {
|
||||
// encode everything except special characters used in certain hash parameters:
|
||||
// "/" in map states, ":", ",", {" and "}" in background
|
||||
return encodeURIComponent(s).replace(/(%2F|%3A|%2C|%7B|%7D)/g, decodeURIComponent);
|
||||
}
|
||||
return Object.keys(obj).sort().map(function(key) {
|
||||
return encodeURIComponent(key) + '=' + (
|
||||
noencode ? softEncode(obj[key]) : encodeURIComponent(obj[key]));
|
||||
|
||||
Reference in New Issue
Block a user