summaryrefslogtreecommitdiff
path: root/framework/Web/THttpRequest.php
diff options
context:
space:
mode:
authorxue <>2005-12-25 03:26:35 +0000
committerxue <>2005-12-25 03:26:35 +0000
commit47562d9863c63a70c03fabc17f799fc702472ee3 (patch)
tree2bcb2eb1fa0bc2d7ee93cabf63a6146ef47cbf3f /framework/Web/THttpRequest.php
parent14b7b01302f41051e9c86acab252209a95bf89f8 (diff)
Fixed HTML encoding problem.
Diffstat (limited to 'framework/Web/THttpRequest.php')
-rw-r--r--framework/Web/THttpRequest.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php
index d42035df..a6fcdf55 100644
--- a/framework/Web/THttpRequest.php
+++ b/framework/Web/THttpRequest.php
@@ -335,21 +335,23 @@ class THttpRequest extends TModule
* @param string service ID
* @param string service parameter
* @param array GET parameters, null if not needed
+ * @param boolean whether to encode the ampersand in URL, defaults to false.
* @return string URL
*/
- public function constructUrl($serviceID,$serviceParam,$getItems=null)
+ public function constructUrl($serviceID,$serviceParam,$getItems=null,$encodeAmpersand=false)
{
$url=$this->getApplicationPath();
$url.='?'.$serviceID.'=';
if(!empty($serviceParam))
$url.=$serviceParam;
+ $amp=$encodeAmpersand?'&amp;':'&';
if(is_array($getItems) || $getItems instanceof Traversable)
{
foreach($getItems as $name=>$value)
- $url.='&amp;'.urlencode($name).'='.urlencode($value);
+ $url.=$amp.urlencode($name).'='.urlencode($value);
}
if(defined('SID') && SID != '')
- $url.='&amp;'.SID;
+ $url.=$amp.SID;
return $url;
}