From: stekkel Date: Tue, 22 Oct 2002 12:33:18 +0000 (+0000) Subject: Added var $link to set_url_var so we correctly can set the new uri with X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=59be1a7538a2b77a6a763c1da258edf92667fce3;p=squirrelmail.git Added var $link to set_url_var so we correctly can set the new uri with & 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 --- diff --git a/functions/html.php b/functions/html.php index 62bcafcf..b926f736 100644 --- a/functions/html.php +++ b/functions/html.php @@ -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('/&/','&',$url); + preg_replace('/&/','&',$url); switch (true) { case (preg_match($pat_a[0],$url,$regs)): $k = $regs[1]; @@ -120,7 +120,9 @@ if ($k) { if ($val) { $rpl = "$k=$val"; -// $rpl = preg_replace('/&/','&',$rpl); + if ($link) { + $rpl = preg_replace('/&/','&',$rpl); + } } else { $rpl = ''; }