]> git.pld-linux.org Git - packages/dokuwiki.git/blame - dokuwiki-mail-headerencodequotes.patch
- up to 2009-01-26 rc
[packages/dokuwiki.git] / dokuwiki-mail-headerencodequotes.patch
CommitLineData
5ec41771
ER
1--- dokuwiki/inc/mail.php~ 2008-02-25 16:51:02.000000000 +0200
2+++ dokuwiki/inc/mail.php 2008-02-25 16:51:07.741031127 +0200
3@@ -124,7 +125,16 @@
673aa20a
ER
4 }
5
6 if(!utf8_isASCII($text)){
7- $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text,0).'?=';
8+ // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?="
9+ if (preg_match('/^"(.+)"$/', $text, $matches)) {
5ec41771 10+ $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="';
673aa20a 11+ } else {
5ec41771 12+ $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text, 0).'?=';
673aa20a 13+ }
5ec41771
ER
14+ // additionally the space character should be encoded as =20 (or each
15+ // word QP encoded separately).
16+ // however this is needed only in mail headers, not globally in mail_quotedprintable_encode().
17+ $text = str_replace(" ", "=20", $text);
673aa20a
ER
18 }
19 }else{
20 $text = '';
This page took 0.027761 seconds and 4 git commands to generate.