cvs: smarty / NEWS /libs/plugins function.mailto.php
[email protected] ("boots") Tue, 20 Jun 2006 19:10:56 -0000
| Newsgroups | php.smarty.cvs |
|---|---|
| Message-ID | <cvsboots1150830656@cvsserver> |
boots Tue Jun 20 19:10:56 2006 UTC
Modified files:
/smarty NEWS
/smarty/libs/plugins function.mailto.php
Log:
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
http://cvs.php.net/viewvc.cgi/smarty/NEWS?r1=1.534&r2=1.535&diff_format=u
Index: smarty/NEWS
diff -u smarty/NEWS:1.534 smarty/NEWS:1.535
--- smarty/NEWS:1.534 Tue Jun 20 16:50:41 2006
+++ smarty/NEWS Tue Jun 20 19:10:56 2006
@@ -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)
http://cvs.php.net/viewvc.cgi/smarty/libs/plugins/function.mailto.php?r1=1.15&r2=1.16&diff_format=u
Index: smarty/libs/plugins/function.mailto.php
diff -u smarty/libs/plugins/function.mailto.php:1.15 smarty/libs/plugins/function.mailto.php:1.16
--- smarty/libs/plugins/function.mailto.php:1.15 Fri Feb 25 17:08:28 2005
+++ smarty/libs/plugins/function.mailto.php Tue Jun 20 19:10:56 2006
@@ -62,6 +62,8 @@
// 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 @@
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':