Added var $link to set_url_var so we correctly can set the new uri with
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 22 Oct 2002 12:33:18 +0000 (12:33 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 22 Oct 2002 12:33:18 +0000 (12:33 +0000)
&amp; if it concerns a link or & when it concerns a header redirect.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3928 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/html.php

index 62bcafc..b926f73 100644 (file)
@@ -79,7 +79,7 @@
 
     /* handy function to set url vars */
     /* especially usefull when $url = $PHP_SELF */
-    function set_url_var($url, $var, $val=0) {
+    function set_url_var($url, $var, $val=0, $link=true) {
         $k = '';
         $ret = '';
         $pat_a = array (
@@ -88,7 +88,7 @@
                        '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                        '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                      );
-//     preg_replace('/&amp;/','&',$url);            
+       preg_replace('/&amp;/','&',$url);            
         switch (true) {
             case (preg_match($pat_a[0],$url,$regs)):
                 $k = $regs[1];
         if ($k) {
             if ($val) {
                 $rpl = "$k=$val";
-//             $rpl = preg_replace('/&/','&amp;',$rpl);
+               if ($link) {
+                   $rpl = preg_replace('/&/','&amp;',$rpl);
+               }
             } else {
                 $rpl = '';
             }