[geeklog-hg] geeklog: Fixed bug which prevented Com_Mail to send email to add...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Tue Nov 10 10:14:52 EST 2015


changeset 9647:a5e13f09b8aa
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/a5e13f09b8aa
user: Tom
date: Tue Nov 10 10:09:09 2015 -0500
description:
Fixed bug which prevented Com_Mail to send email to addresses that has had the COM_formatEmailAddress used on them

diffstat:

 public_html/lib-common.php |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (25 lines):

diff -r bfc4c266cd80 -r a5e13f09b8aa public_html/lib-common.php
--- a/public_html/lib-common.php	Mon Nov 02 13:58:58 2015 -0500
+++ b/public_html/lib-common.php	Tue Nov 10 10:09:09 2015 -0500
@@ -4181,8 +4181,10 @@
 
     static $mailobj;
     
-    // Emails should be validated already but double check
-    if (COM_isEmail($to)) {    
+    // Emails should be validated already but double check not empty (OAuth user most likely)
+    // Can't use COM_isEmail to validate as some mail forms (like profiles.php) uses COM_formatEmailAddress on to address which does not validate
+    // COM_isEmail should be fixed at some point to handle email address that have used COM_formatEmailAddress ...
+    if (!empty($to)) {    
         if (empty($from)) {
             $from = COM_formatEmailAddress($_CONF['site_name'], $_CONF['site_mail']);
         }
@@ -4265,7 +4267,7 @@
             COM_errorLog($retval->toString(), 1);
         }
     } else {
-        COM_errorLog("Invalid To address '$To' sent to COM_Mail.", 1);
+        COM_errorLog("Invalid To address '$to' sent to COM_Mail.", 1);
     }
 
     return($retval === true ? true : false);



More information about the geeklog-cvs mailing list