From 2dd7131e1ec3ab51093ec8d734a3ba9d75b4634e Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Tue, 27 Nov 2012 13:48:31 +0800 Subject: [PATCH] MDL-35966 Assignment - Localisation issue - use userdate not strftime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is causing a database error (reported on MySQL) when strftime returns non-utf8 characters. This occurs when sending assignment notifications. This was reported and a solution provided by Chien Wen-Chang(簡文章). --- mod/assign/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/locallib.php b/mod/assign/locallib.php index 6f449a9680c..5f354fbe6c0 100644 --- a/mod/assign/locallib.php +++ b/mod/assign/locallib.php @@ -2483,7 +2483,7 @@ class assign { $info->username = fullname($userfrom, true); $info->assignment = format_string($assignmentname,true, array('context'=>$context)); $info->url = $CFG->wwwroot.'/mod/assign/view.php?id='.$coursemodule->id; - $info->timeupdated = strftime('%c',$updatetime); + $info->timeupdated = userdate($updatetime, get_string('strftimerecentfull')); $postsubject = get_string($messagetype . 'small', 'assign', $info); $posttext = self::format_notification_message_text($messagetype, $info, $course, $context, $modulename, $assignmentname);