[mapserver-commits] r10699 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Nov 1 20:09:09 EDT 2010


Author: assefa
Date: 2010-11-01 17:09:09 -0700 (Mon, 01 Nov 2010)
New Revision: 10699

Modified:
   trunk/mapserver/mapwfs.c
Log:
WFS: PROPERTYNAME does not always requires parentheses (#3596)

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2010-11-01 22:08:23 UTC (rev 10698)
+++ trunk/mapserver/mapwfs.c	2010-11-02 00:09:09 UTC (rev 10699)
@@ -1728,9 +1728,19 @@
               /*we parse the propertyname parameter only once*/
               if (papszPropertyName == NULL)
               {
-                  if (strlen(pszPropertyName) > 0 && pszPropertyName[0] == '(') 
+                  if (strlen(pszPropertyName) > 0 && (pszPropertyName[0] == '(' || numlayers == 1))
                   {
-                      tokens = msStringSplit(pszPropertyName+1, '(', &nPropertyNames);
+                      if (numlayers == 1 && pszPropertyName[0] != '(')
+                      {
+                        /* Accept PROPERTYNAME without () when there is a single TYPENAME */
+                          char* pszTmpPropertyName = malloc(1+strlen(pszPropertyName)+1+1);
+                          sprintf(pszTmpPropertyName, "(%s)", pszPropertyName);
+                          tokens = msStringSplit(pszTmpPropertyName+1, '(', &nPropertyNames);
+                          free(pszTmpPropertyName);
+                      }
+                      else
+                          tokens = msStringSplit(pszPropertyName+1, '(', &nPropertyNames);
+
                       /*expecting to always have a list of property names equal to
                         the number of layers(typename)*/
                       if (nPropertyNames != numlayers)



More information about the mapserver-commits mailing list