]> git.mjollnir.org Git - moodle.git/commitdiff
email_to_user: MDL-16328 - prevent empty receeipent address
authorpoltawski <poltawski>
Thu, 19 Mar 2009 10:35:08 +0000 (10:35 +0000)
committerpoltawski <poltawski>
Thu, 19 Mar 2009 10:35:08 +0000 (10:35 +0000)
Be a bit defensive as it seems to be possible for this to happen
with LDAP auth

lib/moodlelib.php

index 75ff6179b8e7d42dd8393de14da2ec47655b98af..400bd3f2ad87795ac25ef716b6902ce4a73574ba 100644 (file)
@@ -4075,7 +4075,7 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml='', $a
     global $CFG, $FULLME, $MNETIDPJUMPURL;
     static $mnetjumps = array();
 
-    if (empty($user)) {
+    if (empty($user) || empty($user->email)) {
         return false;
     }