SOURCES: dokuwiki-mail-headerencodequotes.patch - discard spaces i...

glen glen at pld-linux.org
Mon Feb 25 15:58:08 CET 2008


Author: glen                         Date: Mon Feb 25 14:58:08 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- discard spaces in email header. another fix for evolution, which apparently follows RFCs

---- Files affected:
SOURCES:
   dokuwiki-mail-headerencodequotes.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/dokuwiki-mail-headerencodequotes.patch
diff -u SOURCES/dokuwiki-mail-headerencodequotes.patch:1.1 SOURCES/dokuwiki-mail-headerencodequotes.patch:1.2
--- SOURCES/dokuwiki-mail-headerencodequotes.patch:1.1	Mon Feb 25 15:39:41 2008
+++ SOURCES/dokuwiki-mail-headerencodequotes.patch	Mon Feb 25 15:58:02 2008
@@ -1,16 +1,20 @@
---- dokuwiki/inc/mail.php~	2008-02-25 16:32:34.000000000 +0200
-+++ dokuwiki/inc/mail.php	2008-02-25 16:32:58.878702838 +0200
-@@ -124,7 +125,12 @@
+--- dokuwiki/inc/mail.php~	2008-02-25 16:51:02.000000000 +0200
++++ dokuwiki/inc/mail.php	2008-02-25 16:51:07.741031127 +0200
+@@ -124,7 +125,16 @@
        }
  
        if(!utf8_isASCII($text)){
 -        $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text,0).'?=';
 +        // put the quotes outside as in =?UTF-8?Q?"Elan Ruusam=C3=A4e"?= vs "=?UTF-8?Q?Elan Ruusam=C3=A4e?="
 +        if (preg_match('/^"(.+)"$/', $text, $matches)) {
-+          $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1],0).'?="';
++          $text = '"=?UTF-8?Q?'.mail_quotedprintable_encode($matches[1], 0).'?="';
 +        } else {
-+          $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text,0).'?=';
++          $text = '=?UTF-8?Q?'.mail_quotedprintable_encode($text, 0).'?=';
 +        }
++        // additionally the space character should be encoded as =20 (or each
++        // word QP encoded separately).
++        // however this is needed only in mail headers, not globally in mail_quotedprintable_encode().
++        $text = str_replace(" ", "=20", $text);
        }
      }else{
        $text = '';
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/dokuwiki-mail-headerencodequotes.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list