]>
Commit | Line | Data |
---|---|---|
107aba6f ER |
1 | --- dokuwiki/inc/mail.php~ 2009-11-10 15:32:16.000000000 +0200 |
2 | +++ dokuwiki/inc/mail.php 2009-11-10 15:34:00.074347495 +0200 | |
3 | @@ -164,8 +164,17 @@ | |
4 | } | |
673aa20a | 5 | |
107aba6f ER |
6 | if(!utf8_isASCII($text)){ |
7 | - $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text,0).'?='; | |
8 | - } | |
9 | + // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?=" | |
10 | + if (preg_match('/^"(.+)"$/', $text, $matches)) { | |
11 | + $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="'; | |
12 | + } else { | |
13 | + $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text, 0).'?='; | |
14 | + } | |
15 | + // additionally the space character should be encoded as =20 (or each | |
16 | + // word QP encoded separately). | |
17 | + // however this is needed only in mail headers, not globally in mail_quotedprintable_encode(). | |
18 | + $text = str_replace(" ", "=20", $text); | |
19 | + } | |
20 | }else{ | |
21 | $text = ''; | |
22 | } |