[Mapbender-commits] r6570 - branches/2.5/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jul 5 07:58:44 EDT 2010


Author: verenadiewald
Date: 2010-07-05 11:58:44 +0000 (Mon, 05 Jul 2010)
New Revision: 6570

Modified:
   branches/2.5/http/classes/class_wfs.php
Log:
check if featuretype abstract element is set

Modified: branches/2.5/http/classes/class_wfs.php
===================================================================
--- branches/2.5/http/classes/class_wfs.php	2010-07-05 11:39:43 UTC (rev 6569)
+++ branches/2.5/http/classes/class_wfs.php	2010-07-05 11:58:44 UTC (rev 6570)
@@ -22,8 +22,8 @@
 */
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-require_once(dirname(__FILE__)."/class_connector.php");
-require_once(dirname(__FILE__)."/class_administration.php");
+require_once(dirname(__FILE__)."/class_connector.php");
+require_once(dirname(__FILE__)."/class_administration.php");
 
 class wfs {
 
@@ -64,7 +64,7 @@
 	$values = null;
 	$tags = null;
 	$admin = new administration();
-	$this->wfs_getcapabilities_doc = $admin->char_encode($data);
+	$this->wfs_getcapabilities_doc = $admin->char_encode($data);
 	$this->wfs_upload_url = $url;
 	
 	# for temporary wfs a id has to be created...
@@ -75,7 +75,7 @@
 	xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
 	xml_parse_into_struct($parser,$this->wfs_getcapabilities_doc,$values,$tags);
 	//xml_parse_into_struct($parser,$data,$values,$tags);
-	
+	
 	xml_parser_free($parser);
 	
 	$section = false;
@@ -161,7 +161,12 @@
 			$featuretype_title = trim($this->stripEndlineAndCarriageReturn($element[value]));
 		}
 		if($section == "featuretype" && strtoupper($element[tag]) == "ABSTRACT"){
-			$featuretype_abstract = trim($element[value]);
+			if(isset($element[value])) {
+				$featuretype_abstract = trim($element[value]);
+			}
+			else {
+				$featuretype_abstract = "";
+			}
 		}
 		if($section == "featuretype" && strtoupper($element[tag]) == "SRS"){
 			$featuretype_srs = trim($element[value]);
@@ -195,7 +200,7 @@
 } 
 function addFeaturetype($name,$title,$abstract,$srs,$url,$version){
 	$this->wfs_featuretype[count($this->wfs_featuretype)] = new featuretype($name,$title,$abstract,$srs,$url,$version);
-}
+}
  function stripEndlineAndCarriageReturn($string) {
 	  	return preg_replace("/\n/", "", preg_replace("/\r/", " ", $string));
 	  }
@@ -611,7 +616,12 @@
 			$featuretype_title = $this->stripEndlineAndCarriageReturn($element[value]);
 		}
 		if($section == "featuretype" && strtoupper($element[tag]) == "ABSTRACT"){
-			$featuretype_abstract = $this->$element[value];
+			if(isset($element[value])) {
+				$featuretype_abstract = $this->$element[value];
+			}
+			else {
+				$featuretype_abstract = "";
+			}
 		}
 		if($section == "featuretype" && strtoupper($element[tag]) == "SRS"){
 			$featuretype_srs = $element[value];



More information about the Mapbender_commits mailing list