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

ChangeLog
t3lib/class.t3lib_div.php

index 7293eb7..f1f6281 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-02  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #10769: Wrong encoded email header (thanks to Ivan Kartolo)
+
 2009-07-20  Ingo Renner  <ingo@typo3.org>
 
        * Fixed bug: #11006: Tooltip for page path in Page/List module is missing (thanks to Steffen Gebert)
index fe6caf3..d348f6a 100755 (executable)
@@ -4855,7 +4855,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;