Parameters for URLs should be URI encoded. Add test for params that need

to be URI encoded in test_Util, and add Tim Schaub's patch from #381 to make
test pass.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1909 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-11-18 15:35:02 +00:00
parent b4ae7778b6
commit d77b849405
2 changed files with 3 additions and 1 deletions

View File

@@ -380,7 +380,8 @@ OpenLayers.Util.getParameterString = function(params) {
for (var key in params) {
var value = params[key];
if ((value != null) && (typeof value != 'function')) {
paramsArray.push(key + "=" + value);
paramsArray.push(encodeURIComponent(key) + "=" +
encodeURIComponent(value));
}
}

View File

@@ -181,6 +181,7 @@
}
t.eq( OpenLayers.Util.getParameterString(params), "foo=bar&chicken=1.5", "getParameterString returns correctly");
t.eq( OpenLayers.Util.getParameterString({'a:':'b='}), "a%3A=b%3D", "getParameterString returns correctly with non-ascii keys/values");
}
function test_08_Util_createAlphaImageDiv(t) {