From: moodler Date: Tue, 18 Apr 2006 09:16:22 +0000 (+0000) Subject: FIx for slashes problem in bug 5222 (and some others) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f619f8c8ab95f47a86dbe7f2c43d655fed6dfe05;p=moodle.git FIx for slashes problem in bug 5222 (and some others) --- diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 96955ea8ef..163f208cac 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -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, "wwwroot/course/view.php?id={$this->course->id}\">{$this->course->shortname} -> ". "wwwroot/mod/assignment/index.php?id={$this->course->id}\">$strassignments -> $strheading");