Opened 16 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)

mapserver-maplexer-MS_STRING.diff (630 bytes ) - added by dfuhry 16 years ago.

Download all attachments as: .zip

Change History (4)

by dfuhry, 16 years ago

comment:1 by pramsey, 16 years ago

Any reason not to apply this one? Underscores in NAMEs are pretty common...

comment:2 by sdlime, 16 years ago

Nope, an easy one. Do you want to apply or should I?

Steve

comment:3 by pramsey, 16 years ago

Resolution: fixed
Status: newclosed

Committed to 5.0 branch as of r7564. Committed to trunk as of r7563.

Note: See TracTickets for help on using tickets.