From: skodak Date: Thu, 20 Jul 2006 06:36:33 +0000 (+0000) Subject: Bug #6141 - Cron output is not plain text -
 and missing encoding, minor lang... 
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5e60122254be7ff1a58b39da9c78352e02ed9a43;p=moodle.git

Bug #6141 - Cron output is not plain text - 
 and missing encoding, minor lang issues; merged from MOODLE_16_STABLE
---

diff --git a/admin/cron.php b/admin/cron.php
index 3b3d74b4e7..485671a291 100644
--- a/admin/cron.php
+++ b/admin/cron.php
@@ -42,11 +42,23 @@
     //unset test cookie, user must login again anyway
     setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, '/');
 
+/// switch to site language and locale
+	if (!empty($CFG->courselang)) {
+        unset ($CFG->courselang);
+	}
+    if (!empty($SESSION->lang)) {
+        unset ($SESSION->lang);
+    }
+    $USER->lang = '';
+    moodle_setlocale();
+
+/// send mime type and encoding
+    @header('Content-Type: text/plain; charset='.current_charset());
+
 /// Start output log
 
     $timenow  = time();
 
-    mtrace("
");
     mtrace("Server Time: ".date('r',$timenow)."\n\n");
 
 /// Run all cron jobs for each module