[Mapbender-commits] r1689 - in trunk/mapbender/http: classes php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Sep 26 05:49:10 EDT 2007
Author: christoph
Date: 2007-09-26 05:49:10 -0400 (Wed, 26 Sep 2007)
New Revision: 1689
Modified:
trunk/mapbender/http/classes/class_checkInput.php
trunk/mapbender/http/classes/class_stripRequest.php
trunk/mapbender/http/php/mod_getStyles.php
Log:
http://trac.osgeo.org/mapbender/ticket/103
Modified: trunk/mapbender/http/classes/class_checkInput.php
===================================================================
--- trunk/mapbender/http/classes/class_checkInput.php 2007-09-26 09:39:44 UTC (rev 1688)
+++ trunk/mapbender/http/classes/class_checkInput.php 2007-09-26 09:49:10 UTC (rev 1689)
@@ -38,7 +38,7 @@
$v[$i] = db_escape_string($v[$i]);
}
else if($t[$i] == 'i'){
- if(preg_match("/w/",$v[$i])){
+ if(preg_match("/\w/",$v[$i])){
$e = new mb_exception($_SERVER['SCRIPT_FILENAME'].": Unable to parse integer in: ".$q." with: param ".$i.",".$v[i]);
die("wrong data type in sql:".$q);
}
Modified: trunk/mapbender/http/classes/class_stripRequest.php
===================================================================
--- trunk/mapbender/http/classes/class_stripRequest.php 2007-09-26 09:39:44 UTC (rev 1688)
+++ trunk/mapbender/http/classes/class_stripRequest.php 2007-09-26 09:49:10 UTC (rev 1689)
@@ -39,7 +39,8 @@
$tmp = explode("=", $patterns[$i]);
if(mb_strtoupper($tmp[0]) == mb_strtoupper($key)){
$replacement = mb_strtoupper($key) . "=" . $value;
- $this->url = preg_replace($patterns[$i],$replacement, $this->url);
+ $currentPattern = "/" . $patterns[$i] . "/";
+ $this->url = preg_replace($currentPattern, $replacement, $this->url);
$exists = true;
}
}
@@ -92,7 +93,8 @@
$tmp = explode("=", $patterns[$i]);
if(mb_strtoupper($tmp[0]) == mb_strtoupper($key)){
$replacement = "";
- $this->url = preg_replace($patterns[$i],$replacement, $this->url);
+ $currentPattern = "/" . $patterns[$i] . "/";
+ $this->url = preg_replace($currentPattern, $replacement, $this->url);
}
}
$this->encodeGET();
@@ -127,7 +129,7 @@
}
function encodeLegGET(){
- $this->url = preg_replace("&", "\&", $this->url);
+ $this->url = preg_replace("/&/", "\&", $this->url);
return $this->url;
}
}
Modified: trunk/mapbender/http/php/mod_getStyles.php
===================================================================
--- trunk/mapbender/http/php/mod_getStyles.php 2007-09-26 09:39:44 UTC (rev 1688)
+++ trunk/mapbender/http/php/mod_getStyles.php 2007-09-26 09:49:10 UTC (rev 1689)
@@ -126,7 +126,8 @@
@fclose($style_xml);
fclose($style_file);
#include(dirname(__FILE__)."/../../conf/www.conf");
- $sql = "UPDATE wms SET wms_filter = '".preg_replace(basename($login),$style_filename,$login)."' WHERE wms_id = ". $wmsList;
+ $pattern = "/" . basename($login) . "/";
+ $sql = "UPDATE wms SET wms_filter = '".preg_replace($pattern,$style_filename,$login)."' WHERE wms_id = ". $wmsList;
echo $sql;
db_query($sql) or die("unable to change filter!");
}
More information about the Mapbender_commits
mailing list