fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [11923] API: handle empty FROM in email


From: Sigurd Nes
Subject: [Fmsystem-commits] [11923] API: handle empty FROM in email
Date: Mon, 28 Apr 2014 13:54:19 +0000

Revision: 11923
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11923
Author:   sigurdne
Date:     2014-04-28 13:54:19 +0000 (Mon, 28 Apr 2014)
Log Message:
-----------
API: handle empty FROM in email

Modified Paths:
--------------
    trunk/phpgwapi/inc/class.send.inc.php

Modified: trunk/phpgwapi/inc/class.send.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.send.inc.php       2014-04-25 11:15:44 UTC (rev 
11922)
+++ trunk/phpgwapi/inc/class.send.inc.php       2014-04-28 13:54:19 UTC (rev 
11923)
@@ -36,13 +36,27 @@
 
                function msg($service, $to, $subject, $body, $msgtype='', 
$cc='', $bcc='', $from='', $sender='', $content_type='', 
$boundary='Message-Boundary',$attachments=array(), $receive_notification = 
false)
                {
-                       if ($from == '')
+                       if (!$from)
                        {
-                               $from = 
$GLOBALS['phpgw_info']['user']['fullname'].' 
<'.$GLOBALS['phpgw_info']['user']['preferences']['email']['address'].'>';
+                               if($GLOBALS['phpgw_info']['user']['fullname'])
+                               {
+                                       $from = 
$GLOBALS['phpgw_info']['user']['fullname'].' 
<'.$GLOBALS['phpgw_info']['user']['preferences']['email']['address'].'>';
+                               }
+                               else
+                               {
+                                       $from = 
"NoReply<address@hidden'phpgw_info']['server']['hostname']}>";
+                               }
                        }
-                       if ($sender == '')
+                       if (!$sender)
                        {
-                               $sender = 
$GLOBALS['phpgw_info']['user']['fullname'];
+                               if($GLOBALS['phpgw_info']['user']['fullname'])
+                               {
+                                       $sender = 
$GLOBALS['phpgw_info']['user']['fullname'];
+                               }
+                               else
+                               {
+                                       $sender = "NoReply";
+                               }
                        }
 
                        switch( $service )




reply via email to

[Prev in Thread] Current Thread [Next in Thread]