Templating- retrieve querystring parameter should be case-insensitive #4511

Closed
aperi2007 opened this Issue Oct 24, 2012 · 4 comments

Projects

None yet

2 participants

@aperi2007

In a template, actually the retrieve of a parameter from querystring using the sintax:

[parameter-name] is case-sensitive.
So
[parametername] <> [ParameterName]

I know the specs say that the querystring should be case-sensitive.
But because MapServer response both
with

GetFeatureInfo .... &I=10&J=20
or
GetFeatureInfo .... &i=10&j=20

following so a case-unsensitive logic.

I guess also the
templating retrieve parameter should follow the same logic case-insensitive.

@aperi2007

Following the hint from Steve Lime,
http://lists.osgeo.org/pipermail/mapserver-users/2012-October/073545.html

The patch was to change a row of code in the "maptemplate.c" around row 4010:

'
for(i=0; irequest->NumParams; i++) {
...
snprintf(substr, PROCESSLINE_BUFLEN, "[%s]", mapserv->request->ParamNames[i]);
encodedstr = msEncodeHTMLEntities(mapserv->request->ParamValues[i]);
/* outstr = msReplaceSubstring(outstr, substr, encodedstr); BEFORE /
outstr = msCaseReplaceSubstring(outstr, substr, encodedstr); /
NEW */

'

@aperi2007

I tested this change.
It work well.

@sdlime
Member
sdlime commented Nov 1, 2012

@tbonfort, what do you think about adding to 6.2 branch? It's a pretty benign change. I'd actually like the attribute subs to also be case insensitive, e.g. [someitem]. --Steve

@sdlime
Member
sdlime commented Nov 4, 2012

Closing. Can re-open if there is a decision to back port. Will create a separate documentation ticket.

@sdlime sdlime closed this Nov 4, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment