Make sure generated links use & instead of & between GET vars.
[squirrelmail.git] / functions / html.php
index 59f69a25b044d09c20a9e523c7f2517a2ae60d03..217ecfe022aba86e83bd01ef54f822a6fb8d27e6 100644 (file)
@@ -109,7 +109,7 @@ function set_url_var($url, $var, $val=0, $link=true) {
                     '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                     '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                     );
-    preg_replace('/&/','&',$url);
+    $url = preg_replace('/&/','&',$url);
 
     // FIXME: why switch is used instead of if () or one preg_match()
     switch (true) {
@@ -155,6 +155,6 @@ function set_url_var($url, $var, $val=0, $link=true) {
         $pat = "/$k=$v/";
         $url = preg_replace($pat,$rpl,$url);
     }
+    $url = preg_replace('/&/','&',$url);
     return $url;
 }
-?>
\ No newline at end of file