[Mapbender-commits] r4632 - in branches/2.6/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Sep 15 11:34:33 EDT 2009


Author: christoph
Date: 2009-09-15 11:34:31 -0400 (Tue, 15 Sep 2009)
New Revision: 4632

Modified:
   branches/2.6/http/classes/class_universal_gml_factory.php
   branches/2.6/http/php/mod_wfs_gazetteer_server.php
Log:
basic error handling

Modified: branches/2.6/http/classes/class_universal_gml_factory.php
===================================================================
--- branches/2.6/http/classes/class_universal_gml_factory.php	2009-09-15 11:17:58 UTC (rev 4631)
+++ branches/2.6/http/classes/class_universal_gml_factory.php	2009-09-15 15:34:31 UTC (rev 4632)
@@ -39,6 +39,9 @@
 	 */
 	private function getVersionFromXml ($xml) {
 		$simpleXml = simplexml_load_string($xml);
+		if ($simpleXml === false) {
+			return null;
+		}
 		$simpleXml->registerXPathNamespace('gml', 'http://www.opengis.net/gml');
 		
 		$nodeArray = $simpleXml->xpath("//gml:posList");

Modified: branches/2.6/http/php/mod_wfs_gazetteer_server.php
===================================================================
--- branches/2.6/http/php/mod_wfs_gazetteer_server.php	2009-09-15 11:17:58 UTC (rev 4631)
+++ branches/2.6/http/php/mod_wfs_gazetteer_server.php	2009-09-15 15:34:31 UTC (rev 4632)
@@ -141,7 +141,12 @@
 
 	$gmlFactory = new UniversalGmlFactory();
 	$myGml = $gmlFactory->createFromXml($data, $wfsConf);
-	$geoJson = $myGml->toGeoJSON();
+	if (!is_null($myGml)) {
+		$geoJson = $myGml->toGeoJSON();
+	}
+	else {
+		$geoJson = "{}";
+	}
 	
 	header("Content-type:application/x-json; charset=utf-8");
 	echo $geoJson;



More information about the Mapbender_commits mailing list