Merge pull request #1317 from yohanboniface/escape_uri_component

Escape URI component in getParamString
This commit is contained in:
Vladimir Agafonkin 2013-01-27 12:37:32 -08:00
commit 39f9e2be10

View File

@ -81,7 +81,7 @@ L.Util = {
var params = []; var params = [];
for (var i in obj) { for (var i in obj) {
if (obj.hasOwnProperty(i)) { if (obj.hasOwnProperty(i)) {
params.push(i + '=' + obj[i]); params.push(encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]));
} }
} }
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');