]> git.mjollnir.org Git - moodle.git/commitdiff
Don't cache $strforums because the value could change from user to user
authormoodler <moodler>
Mon, 7 Jun 2004 13:24:02 +0000 (13:24 +0000)
committermoodler <moodler>
Mon, 7 Jun 2004 13:24:02 +0000 (13:24 +0000)
mod/forum/lib.php

index cb6d3dcba36b050a0b037730e26729c725c2e373..25a35c9eebe6aebcb915a8fa7443b0ddc5733d0b 100644 (file)
@@ -478,17 +478,14 @@ function forum_cron () {
 function forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $userto, $bare = false) {
     global $CFG;
 
-    static $strforums = NULL;
-    if($strforums === NULL) {
-        $strforums = get_string('forums', 'forum');
-    }
-
     $by = New stdClass;
     $by->name = fullname($userfrom, isteacher($course->id, $userto->id));
     $by->date = userdate($post->modified, "", $userto->timezone);
 
     $strbynameondate = get_string('bynameondate', 'forum', $by);
 
+    $strforums = get_string('forums', 'forum');
+
     $canunsubscribe = ! forum_is_forcesubscribed($forum->id);
     $canreply = forum_user_can_post($forum, $userto);
 
@@ -533,13 +530,9 @@ function forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $u
 function forum_make_mail_html($course, $forum, $discussion, $post, $userfrom, $userto) {
     global $CFG;
 
-    static $strforums = NULL;
-    if($strforums === NULL) {
-        $strforums = get_string('forums', 'forum');
-    }
-
     if ($userto->mailformat == 1) {  // HTML
 
+        $strforums = get_string('forums', 'forum');
         $canreply = forum_user_can_post($forum, $userto);
         $canunsubscribe = ! forum_is_forcesubscribed($forum->id);
 
@@ -561,7 +554,7 @@ function forum_make_mail_html($course, $forum, $discussion, $post, $userfrom, $u
         return $posthtml;
 
     } else {
-      return '';
+        return '';
     }
 }