From: stekkel Date: Mon, 9 Oct 2006 22:11:56 +0000 (+0000) Subject: stops double encoding of &. & became & X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4f113ce583e74a8cb7ccf3960dbb9c9a84a241b9;p=squirrelmail.git stops double encoding of &. & became & git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11894 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/html.php b/functions/html.php index 217ecfe0..004565ba 100644 --- a/functions/html.php +++ b/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 the end */ ); - $url = preg_replace('/&/','&',$url); + $url = str_replace('&','&',$url); // FIXME: why switch is used instead of if () or one preg_match() switch (true) { @@ -143,9 +143,6 @@ function set_url_var($url, $var, $val=0, $link=true) { if ($k) { if ($val) { $rpl = "$k=$val"; - if ($link) { - $rpl = preg_replace('/&/','&',$rpl); - } } else { $rpl = ''; } @@ -155,6 +152,8 @@ function set_url_var($url, $var, $val=0, $link=true) { $pat = "/$k=$v/"; $url = preg_replace($pat,$rpl,$url); } - $url = preg_replace('/&/','&',$url); + if ($link) { + $url = str_replace('&','&',$url); + } return $url; }