[Mapbender-commits] r10215 - in trunk/mapbender/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 23 07:05:32 PDT 2019


Author: armin11
Date: 2019-08-23 07:05:32 -0700 (Fri, 23 Aug 2019)
New Revision: 10215

Modified:
   trunk/mapbender/http/classes/class_cswClient.php
   trunk/mapbender/http/php/mod_callCswMetadata.php
Log:
Fix for wildcard csw search

Modified: trunk/mapbender/http/classes/class_cswClient.php
===================================================================
--- trunk/mapbender/http/classes/class_cswClient.php	2019-08-22 08:39:23 UTC (rev 10214)
+++ trunk/mapbender/http/classes/class_cswClient.php	2019-08-23 14:05:32 UTC (rev 10215)
@@ -498,7 +498,7 @@
 			$cswInterfaceObject = new connector();
 			$cswInterfaceObject->set('httpType','POST');
 			$postData = stripslashes($postData);
-			$e = new mb_exception("classes/class_cswClient.php: post xml: ".$postData);
+			//$e = new mb_exception("classes/class_cswClient.php: post xml: ".$postData);
 			$dataXMLObject = new SimpleXMLElement($postData);
 			$postData = $dataXMLObject->asXML();
 			//$e = new mb_exception($postData);

Modified: trunk/mapbender/http/php/mod_callCswMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_callCswMetadata.php	2019-08-22 08:39:23 UTC (rev 10214)
+++ trunk/mapbender/http/php/mod_callCswMetadata.php	2019-08-23 14:05:32 UTC (rev 10215)
@@ -491,7 +491,10 @@
 	$fullTextFilter = "";
 }
 //$fullTextFilter = "";
+
+//$e = new mb_exception($searchTextArray[0]."".gettype($searchTextArray));
 foreach($searchTextArray as $queryString) {
+//$e = new mb_exception("querystring: ".$queryString);
 	$fullTextFilter .= '<ogc:PropertyIsLike wildCard="*" singleChar="_" escapeChar="">';
 	$fullTextFilter .= '<ogc:PropertyName>AnyText</ogc:PropertyName>';
 	/*if($queryString != '*'){
@@ -498,13 +501,19 @@
 		$queryString = '*' . explode($queryString) . '*';
 	}*/
 	//$queryString = '*' . implode("*", $searchTextArray) . '*';
-	$fullTextFilter .= '<ogc:Literal>'.$queryString.'*</ogc:Literal>';
+	if ($queryString == "*") {
+	    $fullTextFilter .= '<ogc:Literal>*</ogc:Literal>';
+	} else {
+	    $fullTextFilter .= '<ogc:Literal>'.$queryString.'*</ogc:Literal>';
+	}
 	$fullTextFilter .= '</ogc:PropertyIsLike>';
 }
 
+
 if (count($searchTextArray) > 1) {
 	$fullTextFilter .= "</ogc:And>";
 }
+//$e = new mb_exception("fulltextfilter: ".$fullTextFilter);
 /*
 	$fullTextFilter .= '<ogc:PropertyIsLike wildCard="%" singleChar="_" escapeChar="">';
 	$fullTextFilter .= '<ogc:PropertyName>AnyText</ogc:PropertyName>';
@@ -563,7 +572,7 @@
 if ($existsSpatialFilter == true && $searchText !== '' && $searchText !== '*'){
     $additionalFilter = "<ogc:And>".$fullTextFilter.$spatialFilter."</ogc:And>";
 } else {
-    if ($searchText == '' || $searchText == '*') {
+    if ($searchText == '') {
         $additionalFilter = $spatialFilter;
     } else {
 	$additionalFilter = $fullTextFilter;



More information about the Mapbender_commits mailing list