[Mapbender-commits] r1609 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Aug 6 05:54:23 EDT 2007
Author: christoph
Date: 2007-08-06 05:54:23 -0400 (Mon, 06 Aug 2007)
New Revision: 1609
Modified:
trunk/mapbender/http/php/mod_wfs.php
trunk/mapbender/http/php/mod_wfs_result.php
Log:
replaced old string functions by multibyte string function
Modified: trunk/mapbender/http/php/mod_wfs.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs.php 2007-08-06 09:39:33 UTC (rev 1608)
+++ trunk/mapbender/http/php/mod_wfs.php 2007-08-06 09:54:23 UTC (rev 1609)
@@ -59,7 +59,7 @@
<?php
echo "<script language='JavaScript' type='text/javascript'>";
if(isset($_REQUEST['id'])){
- $wfs = split(",",$_REQUEST['id']);
+ $wfs = mb_split(",",$_REQUEST['id']);
$con = db_connect($DBSERVER,$OWNER,$PW);
db_select_db($DB,$con);
@@ -84,11 +84,11 @@
echo "wfs_conf[".$i."]['wfs_conf_abstract'] = '".$row["wfs_conf_abstract"]."';";
echo "wfs_conf[".$i."]['g_label'] = '".$row["g_label"]."';";
echo "wfs_conf[".$i."]['g_label_id'] = '".$row["g_label_id"]."';";
- echo "wfs_conf[".$i."]['g_style'] = \"".str_replace(chr(13), "", str_replace(chr(10), "", $row["g_style"]))."\";";
+ echo "wfs_conf[".$i."]['g_style'] = \"".preg_replace("/\n/", "", preg_replace("/\r/", "", $row["g_style"]))."\";";
echo "wfs_conf[".$i."]['g_button'] = '".$row["g_button"]."';";
echo "wfs_conf[".$i."]['g_button_id'] = '".$row["g_button_id"]."';";
echo "wfs_conf[".$i."]['g_buffer'] = '".$row["g_buffer"]."';";
- echo "wfs_conf[".$i."]['g_res_style'] = \"".str_replace(chr(13), "", str_replace(chr(10), "", $row["g_res_style"]))."\";";
+ echo "wfs_conf[".$i."]['g_res_style'] = \"".preg_replace("/\n/", "", preg_replace("/\r/", "", $row["g_res_style"]))."\";";
echo "wfs_conf[".$i."]['g_use_wzgraphics'] = '".$row["g_use_wzgraphics"]."';";
echo "wfs_conf[".$i."]['fkey_featuretype_id'] = '".$row["fkey_featuretype_id"]."';";
echo "wfs_conf[".$i."]['wfs_getfeature'] = '".$row["wfs_getfeature"]."';";
@@ -148,7 +148,7 @@
echo "wfs_conf[".$i."]['element'][".$cnt."]['element_type'] = '".$row["element_type"]."';";
echo "wfs_conf[".$i."]['element'][".$cnt."]['f_geom'] = '".$row["f_geom"]."';";
echo "wfs_conf[".$i."]['element'][".$cnt."]['f_gid'] = '".$row["f_gid"]."';";
- echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"".(str_replace(chr(13), "", str_replace(chr(10), "", $row["f_form_element_html"])))."\";";
+ echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"".(preg_replace("/\n/", "", preg_replace("/\r/", "", $row["f_form_element_html"])))."\";";
// echo "wfs_conf[".$i."]['element'][".$cnt."]['f_form_element_html'] = \"\";";
echo "wfs_conf[".$i."]['element'][".$cnt."]['f_edit'] = '".$row["f_edit"]."';";
echo "wfs_conf[".$i."]['element'][".$cnt."]['f_mandatory'] = '".$row["f_mandatory"]."';";
Modified: trunk/mapbender/http/php/mod_wfs_result.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_result.php 2007-08-06 09:39:33 UTC (rev 1608)
+++ trunk/mapbender/http/php/mod_wfs_result.php 2007-08-06 09:54:23 UTC (rev 1609)
@@ -32,9 +32,9 @@
db_select_db(DB,$con);
function sepNameSpace($s){
- $c = strpos($s,":");
+ $c = mb_strpos($s,":");
if ($c > 0){
- return substr($s,$c+1);
+ return mb_substr($s,$c+1);
}
else{
return $s;
@@ -108,12 +108,12 @@
$element_str = "";
$geom_str = "";
foreach ($values as $element) {
- if(strtoupper($element[tag]) == strtoupper("gml:featureMember") && $element[type] == "open"){
+ if(mb_strtoupper($element[tag]) == mb_strtoupper("gml:featureMember") && $element[type] == "open"){
$member++;
$section = true;
$cnt_geom = 0;
}
- else if(strtoupper($element[tag]) == strtoupper($typename) && $element[type] == "open") {
+ else if(mb_strtoupper($element[tag]) == mb_strtoupper($typename) && $element[type] == "open") {
$fid = $element[attributes][fid];
}
else if(in_array(sepNameSpace($element[tag]),$geometries) && $element[type] == "open" && $section == true){
@@ -152,8 +152,8 @@
$element_str .= "geom.get(" . $member . ").e.setElement('fid', '".$fid."');\n";
$element_str .= "geom.get(" . $member . ").wfs_conf = ".$js_wfs_conf_id.";\n";
}
- else if(strtoupper($element[tag]) == strtoupper("gml:coordinates") && $geom == true){
- $tmp = str_replace(",,","",str_replace(" ",",",trim($element[value])));
+ else if(mb_strtoupper($element[tag]) == mb_strtoupper("gml:coordinates") && $geom == true){
+ $tmp = preg_replace(",,","",preg_replace(" ",",",trim($element[value])));
$geom_str .= "var tmp1 = '".$tmp."';\n";
$geom_str .= "var tmp = tmp1.split(',');\n";
$geom_str .= "for (var i = 0 ; i < tmp.length ; i+=2) {\n";
@@ -172,7 +172,7 @@
$str = $element[value];
$element_str .= "geom.get(" . $member . ").e.setElement('".sepNameSpace($element[tag])."', '".addslashes($str)."');\n";
}
- else if(strtoupper($element[tag]) == strtoupper("gml:featureMember") && $element[type] == "close"){
+ else if(mb_strtoupper($element[tag]) == mb_strtoupper("gml:featureMember") && $element[type] == "close"){
$section = false;
$el = -1;
}
More information about the Mapbender_commits
mailing list