[Mapbender-commits] r1601 - trunk/mapbender/http/tools
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Aug 6 04:30:31 EDT 2007
Author: christoph
Date: 2007-08-06 04:30:31 -0400 (Mon, 06 Aug 2007)
New Revision: 1601
Modified:
trunk/mapbender/http/tools/mapFiler.php
trunk/mapbender/http/tools/send_post.php
Log:
replaced old string functions by multibyte string function
Modified: trunk/mapbender/http/tools/mapFiler.php
===================================================================
--- trunk/mapbender/http/tools/mapFiler.php 2007-08-06 08:29:39 UTC (rev 1600)
+++ trunk/mapbender/http/tools/mapFiler.php 2007-08-06 08:30:31 UTC (rev 1601)
@@ -48,8 +48,8 @@
/********************************/
function modify($myDir, $myFile){
global $factor;
- $myContent = fopen($myDir."/".$myFile, "r") or die("Datei " . $myDir . " / ". $myFile ." konnte nicht zum Lesen geöffnet werden!");
- $myNewContent = fopen($myDir."/".str_replace(".","_".$factor.".",$myFile), "w") or die("Datei " . $myDir . " / ". str_replace(".","_".$factor.".",$myFile) ." konnte nicht zum Schreiben geöffnet werden!");
+ $myContent = fopen($myDir."/".$myFile, "r") or die("Datei " . $myDir . " / ". $myFile ." konnte nicht zum Lesen ge�ffnet werden!");
+ $myNewContent = fopen($myDir."/".preg_replace(".","_".$factor.".",$myFile), "w") or die("Datei " . $myDir . " / ". preg_replace(".","_".$factor.".",$myFile) ." konnte nicht zum Schreiben ge�ffnet werden!");
fputs($myNewContent, "#Modified by MapbenderTools" . "\n");
fputs($myNewContent, "#Date: ". date("d.m.Y") . "\n");
fputs($myNewContent, "#Factor: ". $factor . "\n\n");
@@ -58,7 +58,7 @@
$myLine = fgets($myContent, 1024);
if(preg_match("/\bSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+ fputs($myNewContent, preg_replace($matches[1], multiplicate($matches[1]), $myLine));
}
}
else if(preg_match("/(.*OFFSET)\s*(\d+.?\d*)(\s*)(\d+.?\d*)(\s*)/i",$myLine,$matches)){
@@ -67,19 +67,19 @@
}
else if(preg_match("/\bMAXSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+ fputs($myNewContent, preg_replace($matches[1], multiplicate($matches[1]), $myLine));
}
}
else if(preg_match("/\bMINSIZE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
if(count($matches) <= 2){
- fputs($myNewContent, str_replace($matches[1], multiplicate($matches[1]), $myLine));
+ fputs($myNewContent, preg_replace($matches[1], multiplicate($matches[1]), $myLine));
}
}
else if(preg_match("/\bSYMBOLSCALE\s*(\d+.?\d*)\s*/i",$myLine,$matches)){
fputs($myNewContent, "# ". $myLine);
}
else if(preg_match("/\bSYMBOLSET\s*(.*)/i",$myLine,$matches)){ //noch nicht fertig
- $arraySymbolFiles[$countSymbolsFiles] = str_replace("\"","",$matches[1]);
+ $arraySymbolFiles[$countSymbolsFiles] = preg_replace("\"","",$matches[1]);
$countSymbolsFiles++;
fputs($myNewContent, $myLine);
}
@@ -101,7 +101,10 @@
# what is to do...
$myFile = basename($myLocation);
$myDir = dirname($myLocation);
- $suffix = strstr($myFile, ".");
+ $suffix = "";
+ if (mb_strpos($myFile, ".") !== false) {
+ $suffix = mb_substr($myFile, mb_strpos($myFile, "."));
+ }}
if(!isset($dir)){
Modified: trunk/mapbender/http/tools/send_post.php
===================================================================
--- trunk/mapbender/http/tools/send_post.php 2007-08-06 08:29:39 UTC (rev 1600)
+++ trunk/mapbender/http/tools/send_post.php 2007-08-06 08:30:31 UTC (rev 1601)
@@ -51,7 +51,7 @@
if (empty($method)) {
$method = 'POST';
}
- $method = strtoupper($method);
+ $method = mb_strtoupper($method);
$fp = fsockopen($host, $port);
fputs($fp, "$method $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
More information about the Mapbender_commits
mailing list