Ticket #2516 (closed defect: fixed)

Opened 5 months ago

Last modified 2 months ago

CGI parameter broken for layers with spaces or underscores

Reported by: dfuhry Assigned to: 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

mapserver-maplexer-MS_STRING.diff (0.6 kB) - added by dfuhry on 02/17/08 18:07:27.

Change History

02/17/08 18:07:27 changed by dfuhry

  • attachment mapserver-maplexer-MS_STRING.diff added.

05/06/08 20:13:09 changed by pramsey

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

05/06/08 22:45:23 changed by sdlime

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

Steve

05/07/08 00:04:42 changed by pramsey

  • status changed from new to closed.
  • resolution set to fixed.

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