From: poltawski Date: Thu, 19 Mar 2009 10:35:08 +0000 (+0000) Subject: email_to_user: MDL-16328 - prevent empty receeipent address X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2029fcf47f9cb39b4746049d241774d9a2781b6d;p=moodle.git email_to_user: MDL-16328 - prevent empty receeipent address Be a bit defensive as it seems to be possible for this to happen with LDAP auth --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 75ff6179b8..400bd3f2ad 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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; }