[mapserver-commits] r11962 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Jul 20 09:02:57 EDT 2011


Author: aboudreault
Date: 2011-07-20 06:02:57 -0700 (Wed, 20 Jul 2011)
New Revision: 11962

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapogcfilter.c
Log:
Fixed OGC filter using expressions (#3481)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-07-20 12:58:53 UTC (rev 11961)
+++ trunk/mapserver/HISTORY.TXT	2011-07-20 13:02:57 UTC (rev 11962)
@@ -14,6 +14,9 @@
 
 Current Version (SVN trunk, 6.1-dev, future 6.2): 
 -------------------------------------------------
+
+- Fixed OGC filter using expressions (#3481)
+
 - Fix incorrect rendering of GD lines between 1 and 2 pixels wide (#3962)
 
 - Add gamma correction to AGG polygon rendering (#3165)

Modified: trunk/mapserver/mapogcfilter.c
===================================================================
--- trunk/mapserver/mapogcfilter.c	2011-07-20 12:58:53 UTC (rev 11961)
+++ trunk/mapserver/mapogcfilter.c	2011-07-20 13:02:57 UTC (rev 11962)
@@ -31,6 +31,7 @@
 
 #ifdef USE_OGR
 #include "cpl_minixml.h"
+#include "cpl_string.h"
 #endif
 
 #include "mapogcfilter.h"
@@ -418,6 +419,8 @@
 
     if (szExpression)
     {
+        char *escapedTextString;
+
         if (bConcatWhere)
           pszBuffer = msStringConcatenate(pszBuffer, "WHERE ");
 
@@ -441,8 +444,10 @@
 	if(lp->filter.string && lp->filter.type == MS_EXPRESSION)
 	  pszBuffer = msStringConcatenate(pszBuffer, ")");
         
-        
-        msLoadExpressionString(&lp->filter, pszBuffer);
+        escapedTextString = msStringEscape(pszBuffer); 
+        msLoadExpressionString(&lp->filter, 
+                               (char*)CPLSPrintf("\"%s\"", escapedTextString)); 
+        free(escapedTextString); 
         free(szExpression);
     }
 



More information about the mapserver-commits mailing list