[BUGFIX] Don't set empty from-name when sending email 04/17504/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 13 Jan 2013 13:49:45 +0000 (14:49 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 12 Apr 2013 20:57:51 +0000 (22:57 +0200)
If no name is specified, only an email-address, for a sender
avoid setting an empty "from"-parameter.

Change-Id: I4274fd6d227d56d81b42be549e3780a2a29e06cc
Fixes: #44484
Releases: 4.7, 6.0, 6.1
Reviewed-on: https://review.typo3.org/17504
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php

index 5456264..3ce447f 100644 (file)
@@ -141,7 +141,11 @@ class MailPostProcessor implements \TYPO3\CMS\Form\PostProcess\PostProcessorInte
                if (preg_match('/\\s|,/', $fromName) >= 1) {
                        $fromName = '"' . $fromName . '"';
                }
-               $from = array($fromEmail => $fromName);
+               if (!empty($fromName)) {
+                       $from = array($fromEmail => $fromName);
+               } else {
+                       $from = $fromEmail;
+               }
                $this->mailMessage->setFrom($from);
        }