diff options
author | xue <> | 2005-12-25 03:26:35 +0000 |
---|---|---|
committer | xue <> | 2005-12-25 03:26:35 +0000 |
commit | 47562d9863c63a70c03fabc17f799fc702472ee3 (patch) | |
tree | 2bcb2eb1fa0bc2d7ee93cabf63a6146ef47cbf3f /framework/Web/THttpRequest.php | |
parent | 14b7b01302f41051e9c86acab252209a95bf89f8 (diff) |
Fixed HTML encoding problem.
Diffstat (limited to 'framework/Web/THttpRequest.php')
-rw-r--r-- | framework/Web/THttpRequest.php | 8 |
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?'&':'&';
if(is_array($getItems) || $getItems instanceof Traversable)
{
foreach($getItems as $name=>$value)
- $url.='&'.urlencode($name).'='.urlencode($value);
+ $url.=$amp.urlencode($name).'='.urlencode($value);
}
if(defined('SID') && SID != '')
- $url.='&'.SID;
+ $url.=$amp.SID;
return $url;
}
|