]> git.mjollnir.org Git - moodle.git/commitdiff
Merged two recent checkins from Moodle 1.7, stripslashes and navbar fixes
authormoodler <moodler>
Tue, 17 Oct 2006 09:10:15 +0000 (09:10 +0000)
committermoodler <moodler>
Tue, 17 Oct 2006 09:10:15 +0000 (09:10 +0000)
mod/forum/post.php

index 91345776d3f6ac44ca570cfbdba712a29bdef258..0b2705ba672b6c69d18f0780668b48f5069309e8 100644 (file)
@@ -46,7 +46,7 @@
         }
 
         $strforums = get_string('modulenameplural', 'forum');
-        if ($course->category) {
+        if ($course->id != SITEID) {
             print_header($course->shortname, $course->fullname,
                  "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->
                   <a href=\"../forum/index.php?id=$course->id\">$strforums</a> ->
             }
         }
 
+        $post->subject = stripslashes_safe($post->subject);
+        $post->message = stripslashes_safe($post->message);
+
     } else if (!empty($forum)) {      // User is starting a new discussion in a forum
 
         $SESSION->fromurl = $_SERVER["HTTP_REFERER"];
     }
 
     if (empty($post->subject)) {
-        $formstart = "theform.subject";
+        $formstart = 'theform.subject';
     } else {
-        $formstart = "";
+        $formstart = '';
     }
 
     if ($post->parent) {
-        $navtail = "<a href=\"discuss.php?d=$discussion->id\">".format_string($toppost->subject,true)."</a> -> ".get_string("editing", "forum");
+        $navtail = ' -> <a href="discuss.php?d='.$discussion->id.'">'.format_string($toppost->subject,true).'</a> -> '.
+                    get_string('editing', 'forum');
     } else {
-        $navtail = format_string($toppost->subject);
+        $navtail = ' -> '.format_string($toppost->subject);
     }
 
     if (empty($post->edit)) {
-        $post->edit = "";
+        $post->edit = '';
     }
 
     $strforums = get_string("modulenameplural", "forum");
         // Show the discussion name in the breadcrumbs.
         $strdiscussionname = format_string($discussion->name).':';
     }
-    if ($course->category) {
+    if ($course->id != SITEID) {
         print_header("$course->shortname: $strdiscussionname ".
                       format_string($toppost->subject), "$course->fullname",
                      "<a href=\"../../course/view.php?id=$course->id\">$course->shortname</a> ->