[BUGFIX] Don't set empty from-name when sending email 75/19875/2
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 21:06:05 +0000 (23:06 +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/19875
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/form/Classes/PostProcess/MailPostProcessor.php

index 2b07604..32f8d24 100644 (file)
@@ -140,7 +140,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);
        }