OpenLayers OpenLayers

Changeset 1909

Show
Ignore:
Timestamp:
11/18/06 10:35:02 (2 years ago)
Author:
crschmidt
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Util.js

    r1906 r1909  
    381381        var value = params[key]; 
    382382        if ((value != null) && (typeof value != 'function')) { 
    383             paramsArray.push(key + "=" + value); 
     383            paramsArray.push(encodeURIComponent(key) + "=" + 
     384                             encodeURIComponent(value)); 
    384385        } 
    385386    } 
  • trunk/openlayers/tests/test_Util.html

    r1605 r1909  
    182182 
    183183        t.eq( OpenLayers.Util.getParameterString(params), "foo=bar&chicken=1.5", "getParameterString returns correctly");     
     184        t.eq( OpenLayers.Util.getParameterString({'a:':'b='}), "a%3A=b%3D", "getParameterString returns correctly with non-ascii keys/values");     
    184185    } 
    185186