* In t3lib_div::linkThisUrl(), remove "?" if no parameters were found.
authorKasper Skårhøj <kasper@typo3.org>
Wed, 31 Mar 2004 13:38:06 +0000 (13:38 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Wed, 31 Mar 2004 13:38:06 +0000 (13:38 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@168 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 4951c65..25b09a0 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-03-31  Kasper Skårhøj,,,  <kasper@typo3.com>
 
+       * In t3lib_div::linkThisUrl(), remove "?" if no parameters were found.
+
+2004-03-31  Kasper Skårhøj,,,  <kasper@typo3.com>
+
        * Added "config.doctype = none" support - omits any doctype in the frontend.
 
 2004-03-31  Kasper Skårhøj,,,  <kasper@typo3.com>
index 0f4555f..486d8d9 100755 (executable)
@@ -98,7 +98,7 @@
  * 1198:     function trimExplode($delim, $string, $onlyNonEmptyValues=0)      
  * 1223:     function uniqueArray($valueArray) 
  * 1246:     function removeArrayEntryByValue($array,$cmpValue)        
- * 1275:     function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)        
+ * 1275:     function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)
  * 1302:     function compileSelectedGetVarsFromArray($varList,$getArray,$GPvarAlt=1)  
  * 1326:     function addSlashesOnArray(&$theArray)    
  * 1351:     function stripSlashesOnArray(&$theArray)  
  *
  *              SECTION: SYSTEM INFORMATION
  * 2322:     function getThisUrl()     
- * 2339:     function linkThisScript($getParams=array())       
+ * 2339:     function linkThisScript($getParams=array())
  * 2363:     function linkThisUrl($url,$getParams=array())     
  * 2385:     function getIndpEnv($getEnvName)  
  * 2569:     function milliseconds()   
@@ -2386,11 +2386,15 @@ class t3lib_div {
                $parts = parse_url($url);
                if ($parts['query'])    {
                        parse_str($parts['query'],$getP);
-               } else $getP=array();
+               } else {
+                       $getP = array();
+               }
 
-               $getP=t3lib_div::array_merge_recursive_overrule($getP,$getParams);
+               $getP = t3lib_div::array_merge_recursive_overrule($getP,$getParams);
                $uP = explode('?',$url);
-               $outurl = $uP[0].'?'.t3lib_div::implodeArrayForUrl('',$getP);
+
+               $params = t3lib_div::implodeArrayForUrl('',$getP);
+               $outurl = $uP[0].($params ? '?'.substr($params, 1) : '');
 
                return $outurl;
        }