mapserver 5 expression

Steve Lime Steve.Lime at DNR.STATE.MN.US
Thu Aug 30 15:52:00 EDT 2007


Expressions are not changable via URL configuration, at least not in
their entirety like
you are doing. I took a conservative approach to exposing parameters to
URL when
that support was re-written for 5.0. I was concerned that unchecked
manipulation of
expressions and filters *could* be a security problem, so that is
unavailable.

What do folks think?

Note that it is easy to re-enable. Just change line 162 in maplexer.l:

from <INITIAL>expression ...
to <INITIAL,URL_STRING>expression ...

You can also work around this using runtime substitution. Presumably
you'd write the mapfile
entry like so:

  LAYER
    NAME 'fastvisa'
    ...
    CLASS
        EXPRESSION ([FNR]=%myid%)
    END
  END

and would have a URL like ...&myid=210176493&...

The advantage here is the you make the decision to enable that level of
configuration, plus you
can apply a regex filter to the value passed in from the URL and if the
value doesn't match that
pattern then no substitution is made:

  LAYER
    NAME 'fastvisa'
    ...
    METADATA
       myid_validation_pattern   '^\d{9}$'
    END
    CLASS
        EXPRESSION ([FNR]=%myid%)
    END
  END

In this example the input value for myid must consist of exactly 9
digits.

Steve

>>> On 8/29/2007 at 7:28 AM, in message
<BAY116-F20CE60F662031E0BD05A8182CC0 at phx.gbl>, Lars-Göran Edholm
<lged_morris at HOTMAIL.COM> wrote:
> Hi again!
> Tried with
> &map.layer[fastvisa].class[0]=EXPRESSION+([FNR]=210176493)
> gives the error:
> loadClass(): Unknown identifier. Parsing error near
(EXPRESSION):(line 1)
> with
> &map.layer[fastvisa].class[0].EXPRESSION=([FNR]=210176493)
> i get
> loadClass(): Unknown identifier. Parsing error near (():(line 1)
> 
> Seems that there is something with Expression that is wrong.
> Lars-Göran Edholm
> 
> _________________________________________________________________
> Upptäck kärleken på MSN 
> http://match.se.msn.com/channel/index.aspx?trackingid=1002962



More information about the mapserver-users mailing list