mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +02:00
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
This commit is contained in:
2
NEWS
2
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)
|
- emulate %l in the date_format modifier on windows (boots)
|
||||||
- fix handling of apostrophes in capitalize modifier (Alec Smecher, boots)
|
- fix handling of apostrophes in capitalize modifier (Alec Smecher, boots)
|
||||||
|
|
||||||
|
@@ -62,6 +62,8 @@ function smarty_function_mailto($params, &$smarty)
|
|||||||
|
|
||||||
// netscape and mozilla do not decode %40 (@) in BCC field (bug?)
|
// netscape and mozilla do not decode %40 (@) in BCC field (bug?)
|
||||||
// so, don't encode it.
|
// so, don't encode it.
|
||||||
|
$search = array('%40', '%2C');
|
||||||
|
$replace = array('@', ',');
|
||||||
$mail_parms = array();
|
$mail_parms = array();
|
||||||
foreach ($params as $var=>$value) {
|
foreach ($params as $var=>$value) {
|
||||||
switch ($var) {
|
switch ($var) {
|
||||||
@@ -69,7 +71,7 @@ function smarty_function_mailto($params, &$smarty)
|
|||||||
case 'bcc':
|
case 'bcc':
|
||||||
case 'followupto':
|
case 'followupto':
|
||||||
if (!empty($value))
|
if (!empty($value))
|
||||||
$mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value));
|
$mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'subject':
|
case 'subject':
|
||||||
|
Reference in New Issue
Block a user