From eb3e5c35458fa841609efe0b353c63d2a556cf27 Mon Sep 17 00:00:00 2001 From: boots Date: Tue, 20 Jun 2006 19:10:56 +0000 Subject: [PATCH] update mailto function plugin to work around a firefox/thunderbird escaping bug Thanks to elijahlofgren from the forums for reporting this and providing the necessary patch --- NEWS | 2 ++ libs/plugins/function.mailto.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 9d4f4e6d..f6ed767a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +- update mailto function plugin to work around a firefox/thunderbird + escaping bug (elijahlofgren, boots) - emulate %l in the date_format modifier on windows (boots) - fix handling of apostrophes in capitalize modifier (Alec Smecher, boots) diff --git a/libs/plugins/function.mailto.php b/libs/plugins/function.mailto.php index 64c122ce..20e9ed98 100644 --- a/libs/plugins/function.mailto.php +++ b/libs/plugins/function.mailto.php @@ -62,6 +62,8 @@ function smarty_function_mailto($params, &$smarty) // netscape and mozilla do not decode %40 (@) in BCC field (bug?) // so, don't encode it. + $search = array('%40', '%2C'); + $replace = array('@', ','); $mail_parms = array(); foreach ($params as $var=>$value) { switch ($var) { @@ -69,7 +71,7 @@ function smarty_function_mailto($params, &$smarty) case 'bcc': case 'followupto': if (!empty($value)) - $mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value)); + $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value)); break; case 'subject':