fixed getParameterString to handle null/undefined values correctly. r=elemoine (closes #2157)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9573 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -608,8 +608,12 @@ OpenLayers.Util.getParameterString = function(params) {
|
||||
if (typeof value == 'object' && value.constructor == Array) {
|
||||
/* value is an array; encode items and separate with "," */
|
||||
var encodedItemArray = [];
|
||||
var item;
|
||||
for (var itemIndex=0, len=value.length; itemIndex<len; itemIndex++) {
|
||||
encodedItemArray.push(encodeURIComponent(value[itemIndex]));
|
||||
item = value[itemIndex];
|
||||
encodedItemArray.push(encodeURIComponent(
|
||||
(item === null || item === undefined) ? "" : item)
|
||||
);
|
||||
}
|
||||
encodedValue = encodedItemArray.join(",");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user