From: x2003bruneau Date: Tue, 19 Dec 2006 10:21:49 +0000 (+0000) Subject: Trig a warning when sending a mail without 'From' (and don't send the mail) X-Git-Tag: xorg/0.9.13~174 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=434cd6ddd7e6f8b3fe277a1e7f3eeafab6832245;p=platal.git Trig a warning when sending a mail without 'From' (and don't send the mail) git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1292 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/classes/plmailer.php b/classes/plmailer.php index 1bfe781..e587b91 100644 --- a/classes/plmailer.php +++ b/classes/plmailer.php @@ -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); }