From 2a5e3d244b793315eafcbd8b08fb4dc2b4ec1eaf Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Wed, 6 Feb 2008 10:24:40 +0000 Subject: [PATCH] MDL-6826 Removed the optional_param lines at the top, and set the submit buttons to PARAM_RAW. Also changed !empty() to isset(); Merging from 1.8 --- course/modedit.php | 4 +--- course/moodleform_mod.php | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/course/modedit.php b/course/modedit.php index 6019ec19c81..f9f022dc550 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -12,8 +12,6 @@ $update = optional_param('update', 0, PARAM_INT); $return = optional_param('return', 0, PARAM_BOOL); //return to course/view.php if false or mod/modname/view.php if true $type = optional_param('type', '', PARAM_ALPHANUM); - $submitbutton = optional_param('submitbutton', null, PARAM_ALPHANUM); - $submitbutton2 = optional_param('submitbutton2', null, PARAM_ALPHANUM); if (!empty($add)) { $section = required_param('section', PARAM_INT); @@ -410,7 +408,7 @@ rebuild_course_cache($course->id); - if (!empty($fromform->submitbutton)) { + if (isset($fromform->submitbutton)) { redirect("$CFG->wwwroot/mod/$module->name/view.php?id=$fromform->coursemodule"); } else { redirect("$CFG->wwwroot/course/view.php?id=$course->id"); diff --git a/course/moodleform_mod.php b/course/moodleform_mod.php index cedaa4fed80..506d0f18c7e 100644 --- a/course/moodleform_mod.php +++ b/course/moodleform_mod.php @@ -324,6 +324,7 @@ class moodleform_mod extends moodleform { } $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false); + $mform->setType('buttonar', PARAM_RAW); $mform->closeHeaderBefore('buttonar'); } }