From 4f113ce583e74a8cb7ccf3960dbb9c9a84a241b9 Mon Sep 17 00:00:00 2001 From: stekkel Date: Mon, 9 Oct 2006 22:11:56 +0000 Subject: [PATCH] stops double encoding of &. & became & git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11894 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/html.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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; } -- 2.25.1