Merge branch 'MDL-41851-master' of git://github.com/andrewnicols/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 3 Feb 2015 11:36:00 +0000 (12:36 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 3 Feb 2015 11:36:00 +0000 (12:36 +0100)
mod/forum/lib.php

index d400f47..8bb1995 100644 (file)
@@ -789,10 +789,7 @@ function forum_cron() {
 
                 // If forum_replytouser is not set then send mail using the noreplyaddress.
                 if (empty($CFG->forum_replytouser)) {
-                    // Clone userfrom as it is referenced by $users.
-                    $cloneduserfrom = clone($userfrom);
-                    $cloneduserfrom->email = $CFG->noreplyaddress;
-                    $eventdata->userfrom = $cloneduserfrom;
+                    $eventdata->userfrom = core_user::get_noreply_user();
                 }
 
                 $smallmessagestrings = new stdClass();