From 7cd4a0f6d5df38639bd8c2fba2431c649b81ba45 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 22 Jan 2015 09:42:09 +0800 Subject: [PATCH] MDL-41851 mod_forum: Use noreply user when sending forum notifications --- mod/forum/lib.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index ef99acc00d7..3868548323a 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -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();