[Mapbender-commits] r1269 - trunk/mapbender/owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Apr 20 10:43:13 EDT 2007
Author: uli
Date: 2007-04-20 10:43:13 -0400 (Fri, 20 Apr 2007)
New Revision: 1269
Modified:
trunk/mapbender/owsproxy/http/index.php
Log:
bug fixed
empty style parameter (only one layer is activated whithout style) causes error in php-function key()
Modified: trunk/mapbender/owsproxy/http/index.php
===================================================================
--- trunk/mapbender/owsproxy/http/index.php 2007-04-17 14:46:37 UTC (rev 1268)
+++ trunk/mapbender/owsproxy/http/index.php 2007-04-20 14:43:13 UTC (rev 1269)
@@ -1,5 +1,5 @@
<?php
-# $Id:$
+# $Id$
# http://www.mapbender.org/index.php/Owsproxy
# Module maintainer Uli
# Copyright (C) 2002 CCGIS
@@ -20,19 +20,20 @@
require("../../conf/mapbender.conf");
require("../../http/classes/class_administration.php");
-
+require_once("../../http/classes/class_mb_exception.php");
/***** conf *****/
$imageformats = array("image/png","image/gif","image/jpeg", "image/jpg");
$mbkeys = array("sid",strtolower(ini_get("session.name")),"wms");
/***** conf *****/
-$owskey = array();
+$reqParams = array();
$myKeys = array_keys($_REQUEST);
+// create an associative array with request parameters (get)
for($i=0; $i<count($myKeys); $i++){
$tmp[$i] = removeQM(strtolower($myKeys[$i]));
$$tmp[$i] = $_REQUEST[$myKeys[$i]];
if(!in_array(removeQM(strtolower($myKeys[$i])),$mbkeys)){
- $owskey[removeQM(strtolower($myKeys[$i]))] = $_REQUEST[$myKeys[$i]];
+ $reqParams[removeQM(strtolower($myKeys[$i]))] = $_REQUEST[$myKeys[$i]];
}
}
@@ -89,7 +90,7 @@
break;
default:
$or = $n->checkURL($row["wms_getcapabilities"]);
- $owskey["layers"] = checkLayerPermission($layers);
+ $reqParams["layers"] = checkLayerPermission($layers);
$or = completeURL($or);
getMap($or);
}
@@ -129,13 +130,11 @@
if($format == 'image/gif'){imagegif($im);}
}
function completeURL($url){
- global $owskey;
- $c = 0;
- while ($key = current($owskey)) {
- if($c > 0){ $url .= "&"; }
- $url .= key($owskey)."=".$key;
- $c++;
- next($owskey);
+ global $reqParams;
+ $mykeys = array_keys($reqParams);
+ for($i=0; $i<count($mykeys);$i++){
+ if($i > 0){ $url .= "&"; }
+ $url .= $mykeys[$i]."=".$reqParams[$mykeys[$i]];
}
return $url;
}
More information about the Mapbender_commits
mailing list