Ticket #2327 (closed bug: fixed)
OpenLayers.Util.getParameters not recognize %2C for comma separation
| Reported by: | memch | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | 2.9 Release |
| Component: | Util | Version: | 2.8 |
| Keywords: | Cc: | ||
| State: | Complete |
Description
When i use OpenLayers.Util.getParameters for own parameters like tileurls=domain1/tile.php?z=${z}&x=${x}&y=${y},domain2/tile.php?z=${z}&x=${x}&y=${y}, some chars must be url-encoded when sended from a form (ENCTYPE = "application/x-www-form-urlencoded").
In that case, also that comma between this two urls gets encoded to %2C. The functionality behind OpenLayers.Util.getParameters do not recognize this encoded comma, and will never build an object from.
I found the bug in source in function "OpenLayers.Util.getParameters" (in OL 2.8 in Util.js line 922): On Line 940 a key will be searched with "decodeURIComponent", same for value on line 946. But the search for separating comma in value will be done before "decodeURIComponent" in encoded state. Here, a proper encoded comma is not ",", it is "%2C"!

