From 641826266aff9d816c8e61569be5ec9d67f7cc89 Mon Sep 17 00:00:00 2001 From: xue <> Date: Wed, 3 May 2006 18:40:21 +0000 Subject: Fixed#151 - added sanity check GET parameters in constructUrl() --- framework/Web/THttpRequest.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'framework') diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 71237fa1..9b06076e 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -460,9 +460,12 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar { $name=urlencode($name.'[]'); foreach($value as $v) - $url.=$amp.$name.'='.$v; + { + if(($v=trim($v))!=='') + $url.=$amp.$name.'='.$v; + } } - else + else if(($value=trim($value))!=='') $url.=$amp.urlencode($name).'='.urlencode($value); } } @@ -473,9 +476,12 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar if(is_array($value)) { foreach($value as $v) - $url.=$amp.$name.'[]='.$v; + { + if(($v=trim($v))!=='') + $url.=$amp.$name.'[]='.$v; + } } - else + else if(($value=trim($value))!=='') $url.=$amp.$name.'='.$value; } } -- cgit v1.2.3