Browse Source

Make sure generated links use & instead of & between GET vars.

stevetruckstuff 19 years ago
parent
commit
fb82ed55b8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      functions/html.php

+ 2 - 1
functions/html.php

@@ -109,7 +109,7 @@ function set_url_var($url, $var, $val=0, $link=true) {
                     '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                     '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                     '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                     '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                     );
                     );
-    preg_replace('/&/','&',$url);
+    $url = preg_replace('/&/','&',$url);
 
 
     // FIXME: why switch is used instead of if () or one preg_match()
     // FIXME: why switch is used instead of if () or one preg_match()
     switch (true) {
     switch (true) {
@@ -155,5 +155,6 @@ function set_url_var($url, $var, $val=0, $link=true) {
         $pat = "/$k=$v/";
         $pat = "/$k=$v/";
         $url = preg_replace($pat,$rpl,$url);
         $url = preg_replace($pat,$rpl,$url);
     }
     }
+    $url = preg_replace('/&/','&',$url);
     return $url;
     return $url;
 }
 }