Opened 17 years ago
Closed 16 years ago
#2516 closed defect (fixed)
CGI parameter broken for layers with spaces or underscores
Reported by: | dfuhry | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.0.3 release |
Component: | MapServer C Library | Version: | svn-trunk (development) |
Severity: | major | Keywords: | cgi MS_STRING maplexer maplexer.l |
Cc: |
Description
Changing the presentation style using a CGI parameter is broken for layer names which contain spaces or underscores. For example, the below works fine:
...&map.layer[lakes].class[0].style[0]=...
but both of these:
...&map.layer[all lakes].class[0].style[0]=... ...&map.layer[all_lakes].class[0].style[0]=...
cause the error:
getSymbol(): Symbol definition error. Parsing error near ([):(line 1)
The reason is that spaces and underscores are not considered part of an MS_STRING as parsed by msyylex(). Changing the definition of MS_STRING In maplexer.l from:
<URL_VARIABLE>\[[a-z/\.][a-z0-9/\.\-\=]*\]
to:
<URL_VARIABLE>\[[a-z/\.][a-z0-9/\.\-\=_ ]*\]
fixes the problem. I'm not sure if there are any ill side effects of considering a space or underscore inside a pair of square brackets to be part of a MS_STRING.
A diff is attached.
Attachments (1)
Change History (4)
by , 17 years ago
Attachment: | mapserver-maplexer-MS_STRING.diff added |
---|
comment:1 by , 16 years ago
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Any reason not to apply this one? Underscores in NAMEs are pretty common...