]> git.mjollnir.org Git - moodle.git/commitdiff
FIx for slashes problem in bug 5222 (and some others)
authormoodler <moodler>
Tue, 18 Apr 2006 09:16:22 +0000 (09:16 +0000)
committermoodler <moodler>
Tue, 18 Apr 2006 09:16:22 +0000 (09:16 +0000)
mod/assignment/lib.php

index 96955ea8ef864fc08009e42a5c3b81ae78435f1c..163f208cac1a09c5d5b153636c57c45d3d591d0c 100644 (file)
@@ -316,27 +316,34 @@ class assignment_base {
                 error("Course is misconfigured");
             }
         }
+
         if (empty($action)) {   // Default destination for this form
             $action = $CFG->wwwroot.'/course/mod.php';
         }
 
-        if (empty($form->name)) {
-            $form->name = "";
-        }
         if (empty($form->assignmenttype)) {
-            $form->assignmenttype = "";
+            $form->assignmenttype = '';
         } else {
             $form->assignmenttype = clean_param($form->assignmenttype, PARAM_SAFEDIR);
         }
+
+        if (empty($form->name)) {
+            $form->name = '';
+        } else {
+            $form->name = stripslashes($form->name);
+        }
+
         if (empty($form->description)) {
-            $form->description = "";
+            $form->description = '';
+        } else {
+            $form->description = stripslashes($form->description);
         }
 
         $strname    = get_string('name');
         $strassignments = get_string('modulenameplural', 'assignment');
         $strheading = empty($form->name) ? get_string("type$form->assignmenttype",'assignment') : s(format_string(stripslashes($form->name),true));
 
-        print_header($this->course->shortname.': '.$strheading, "$strheading",
+        print_header($this->course->shortname.': '.$strheading, $this->course->fullname,
                 "<a href=\"$CFG->wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} </a> -> ".
                 "<a href=\"$CFG->wwwroot/mod/assignment/index.php?id={$this->course->id}\">$strassignments</a> -> $strheading");