[BUGFIX] swiftmaileradapter should ignore empty headers 87/19687/2
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 17 Oct 2012 22:32:34 +0000 (00:32 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 6 Apr 2013 16:14:28 +0000 (18:14 +0200)
Further processing empty header-values with
functions like parseAddress() can lead to
unexpected problems.

Change-Id: Ida436f384a6a6a86d7fbd119083a9037157f48df
Fixes: #42106
Releases: 4.5, 4.7, 6.0, 6.1
Reviewed-on: https://review.typo3.org/19687
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/mail/class.t3lib_mail_swiftmaileradapter.php

index 64d7020..cd11f0c 100644 (file)
@@ -139,6 +139,13 @@ class t3lib_mail_SwiftMailerAdapter implements t3lib_mail_MailerAdapter {
                        $this->boundary = $matches[1];
                        return;
                }
+
+               // Ignore empty header-values (like from an 'Reply-To:' without an email-address)
+               $headerValue = trim($headerValue);
+               if (empty($headerValue)) {
+                       return;
+               }
+
                        // process other, real headers
                if ($this->messageHeaders->has($headerName)) {
                        $header = $this->messageHeaders->get($headerName);
@@ -337,4 +344,4 @@ class t3lib_mail_SwiftMailerAdapter implements t3lib_mail_MailerAdapter {
                $this->message->setFrom(array($fromAddress => $fromName));
        }
 }
-?>
\ No newline at end of file
+?>