summaryrefslogtreecommitdiff
path: root/framework/Web/THttpRequest.php
diff options
context:
space:
mode:
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?'&':'&';
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;
}