Trig a warning when sending a mail without 'From' (and don't send the mail)
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 19 Dec 2006 10:21:49 +0000 (10:21 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Tue, 19 Dec 2006 10:21:49 +0000 (10:21 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1292 839d8a87-29fc-0310-9880-83ba4fa771e5

classes/plmailer.php

index 1bfe781..e587b91 100644 (file)
@@ -348,6 +348,10 @@ class PlMailer extends Mail_Mime {
                                  'html_charset' => $this->charset,
                                  'head_charset' => $this->charset));
         $hdrs = $this->headers();
+        if (empty($hdrs['From'])) {
+            trigger_error('Empty "From", mail not sent', E_USER_WARNING);
+            return false;
+        }
         return $this->mail->send($dests, $hdrs, $body);
     }