Skip to content

Commit

Permalink
Converted occurances of PARAM_RAW to appropriate types. See
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Oct 29, 2024
1 parent 1995f9f commit 8a70d8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/driprelease.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function update_availability(array $tabledata, \stdClass $dripdata) {
}
$modulenameplural = get_string('modulenameplural', $dripdata->modtype);
$msg = get_string('updated', 'moodle', $updatecount). " ".$modulenameplural;
$refresh = optional_param('refresh', 0, PARAM_RAW);
$refresh = optional_param('refresh', 0, PARAM_INT);
if (! $refresh) {
\core\notification::add($msg, \core\notification::SUCCESS);
rebuild_course_cache($COURSE->id);
Expand Down
5 changes: 2 additions & 3 deletions driprelease_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function definition() {
global $CFG, $DB, $PAGE, $COURSE;

require_once($CFG->dirroot . '/course/externallib.php');
$modtype = optional_param('modtype', 'quiz', PARAM_RAW);
$modtype = optional_param('modtype', 'quiz', PARAM_TEXT);
$courseid = optional_param('courseid', '', PARAM_INT);

$PAGE->requires->js_call_amd('tool_driprelease/modform', 'init', ['courseid' => $courseid]);
Expand Down Expand Up @@ -119,7 +119,7 @@ public function definition() {
['value' => $driprelease->sessionlength, 'size' => 2]);
$mform->addRule('sessionlength', null, 'required', null, 'client');

$mform->setType('sessionlength', PARAM_RAW);
$mform->setType('sessionlength', PARAM_INT);
$mform->addHelpButton('sessionlength', 'session', 'tool_driprelease');

$mform->addElement('text', 'activitiespersession', get_string('activitiespersession', 'tool_driprelease'), ['size' => '3']);
Expand Down Expand Up @@ -273,6 +273,5 @@ public function add_action_buttons($cancel=true, $submitlabel=null, $submit2labe
}

$mform->addGroup($buttonarray, 'buttonar', '', [' '], false);
$mform->setType('buttonar', PARAM_RAW);
}
}
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// Course module id.
$courseid = optional_param('courseid', 0, PARAM_INT);
$modtype = optional_param('modtype', 'quiz', PARAM_RAW);
$modtype = optional_param('modtype', 'quiz', PARAM_ALPHANUMEXT);

if (!$courseid) {
redirect(new moodle_url('/'));
Expand Down

0 comments on commit 8a70d8f

Please sign in to comment.