[mapserver-users] Passing single quoted strings

Heiko Schröter schroete at iup.physik.uni-bremen.de
Tue Apr 21 02:51:35 EDT 2009


Hello,

i have to pass single quoted strings from Open Layer through mapserver to a 
postgis/postgres database.

i.e. "filter 'value=1 and datum between '2005-1-1' and '2005-1-3' ";
The postgres db expects (afaik) the date in a single quoted string.

The problem is that mapserver stops scanning the filter string when coming 
across the second single quote and bails out.

The Validation string in the mapfile:
    VALIDATION
     'filter' "^."
   END

Even when allowing single quotes explicitly by inserting escaped single quotes 
in the validation string it doesn't work. Escaping the single quotes in the 
assembled OL string won't help either.

Does anyone has an idea of how to pass such strings through mapserver ?

Now i do use an ugly hack of converting the date to abstime on the client side 
(with all the UTC converting hassle) and pass the integer to the db.
i.e. "filter 'value = 1 and abstime between "+fromDate+" and "+toDate+"'";

MapServer version 5.4.0-rc1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER 
INPUT=TIFF INPUT=EPPL7 INPUT=JPEG INPUT=POSTGIS INPUT=SHAPEFILE

Thanks and Regards
Heiko




More information about the mapserver-users mailing list