MDL-41851 mod_forum: Use noreply user when sending forum notifications
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 22 Jan 2015 01:42:09 +0000 (09:42 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Thu, 22 Jan 2015 01:42:12 +0000 (09:42 +0800)
mod/forum/lib.php

index ef99acc..3868548 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();