Fixed bug #10769: Wrong encoded email header
authorOliver Hader <oliver.hader@typo3.org>
Sun, 2 Aug 2009 08:09:56 +0000 (08:09 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 2 Aug 2009 08:09:56 +0000 (08:09 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5749 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_div.php

index 84de842..367996e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Fixed bug #11585: Faulty usage of t3lib_matchCondition in backend template
        * Follow-up to bug #11585: Added unit test for t3lib_matchCondition
+       * Fixed bug #10769: Wrong encoded email header (thanks to Ivan Kartolo)
 
 2009-08-02  Christian Kuhn  <lollli@schwarzbu.ch>
 
index 5243325..e5c04a2 100644 (file)
@@ -5119,7 +5119,12 @@ final class t3lib_div {
                                default:
                                        $qpValue = t3lib_div::quoted_printable($part,1000);
                                        if ($part!=$qpValue)    {
-                                               $qpValue = str_replace(' ','_',$qpValue);       // Encoded words in the header should not contain non-encoded spaces. "_" is a shortcut for "=20". See RFC 2047 for details.
+                                               // Encoded words in the header should not contain non-encoded:
+                                               // * spaces. "_" is a shortcut for "=20". See RFC 2047 for details.
+                                               // * question mark. See RFC 1342 (http://tools.ietf.org/html/rfc1342)
+                                               $search = array(' ', '?');
+                                               $replace = array('_', '=3F');
+                                               $qpValue = str_replace($search, $replace, $qpValue);
                                                $part = '=?'.$charset.'?Q?'.$qpValue.'?=';
                                        }
                                break;