Skip to content

Commit

Permalink
MDL-6826 Removed the optional_param lines at the top, and set the sub…
Browse files Browse the repository at this point in the history
…mit buttons to PARAM_RAW. Also changed !empty() to isset(); Merging from 1.9
  • Loading branch information
nicolasconnault committed Feb 6, 2008
1 parent 04b8b68 commit de6f158
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 5 additions & 7 deletions course/modedit.php
Expand Up @@ -8,12 +8,10 @@

require_login();

$add = optional_param('add', 0, PARAM_ALPHA);
$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);
$add = optional_param('add', 0, PARAM_ALPHA);
$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);

if (!empty($add)) {
$section = required_param('section', PARAM_INT);
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions course/moodleform_mod.php
Expand Up @@ -324,6 +324,7 @@ function add_action_buttons($cancel=true, $submitlabel=null, $submit2label=null)
}

$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
$mform->setType('buttonar', PARAM_RAW);
$mform->closeHeaderBefore('buttonar');
}
}
Expand Down

0 comments on commit de6f158

Please sign in to comment.