[Mapbender-commits] r1145 - trunk/mapbender/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Feb 23 10:58:15 EST 2007
Author: christoph
Date: 2007-02-23 10:58:15 -0500 (Fri, 23 Feb 2007)
New Revision: 1145
Modified:
trunk/mapbender/http/classes/class_wms.php
Log:
bugfix 1589764 wms loading problems when abstract contain linebreak
Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php 2007-02-23 15:06:11 UTC (rev 1144)
+++ trunk/mapbender/http/classes/class_wms.php 2007-02-23 15:58:15 UTC (rev 1145)
@@ -113,7 +113,7 @@
$this->wms_title = $element[value];
}
if(strtoupper($element[tag]) == "ABSTRACT" && $element[level] == '3'){
- $this->wms_abstract = $element[value];
+ $this->wms_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
}
if(strtolower($element[tag]) == "fees"){
$this->fees = $element[value];
@@ -390,7 +390,7 @@
$this->objLayer[$cnt_layer]->layer_title = $element[value];
}
if(strtoupper($element[tag]) == "ABSTRACT"){
- $this->objLayer[$cnt_layer]->layer_abstract = $element[value];
+ $this->objLayer[$cnt_layer]->layer_abstract = $this->stripEndlineAndCarriageReturn($element[value]);
}
if(strtoupper($element[tag]) == "KEYWORD"){
$this->objLayer[$cnt_layer]->layer_keyword[count($this->objLayer[$cnt_layer]->layer_keyword)] = $element[value];
@@ -618,6 +618,9 @@
function addLayer($id,$parent){
$this->objLayer[count($this->objLayer)] = new layer($id,$parent);
}
+ function stripEndlineAndCarriageReturn($string) {
+ return str_replace(chr(13), "", str_replace(chr(10), " ", $string));
+ }
function createJsObjFromWMS($parent=0){
if(!$this->wms_title || $this->wms_title == ""){
echo "alert('Error: no valid capabilities-document !!');";
@@ -1308,7 +1311,7 @@
$this->wms_id = $row2["wms_id"];
$this->wms_version = $row2["wms_version"];
$this->wms_title = $row2["wms_title"];
- $this->wms_abstract = $row2["wms_abstract"];
+ $this->wms_abstract = $this->stripEndlineAndCarriageReturn($row2["wms_abstract"]);
if($row2["wms_owsproxy"] != ""){
$t = OWSPROXY."/".session_id()."/".$row2["wms_owsproxy"]."?";
$this->wms_getmap = $t;
More information about the Mapbender_commits
mailing list