From 69e3c41688b251f4888d26bec88ead96a08a1f54 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 23 Apr 2006 21:07:44 +0000 Subject: [PATCH] page parameter cleanup --- mod/choice/report.php | 5 ++--- mod/choice/view.php | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mod/choice/report.php b/mod/choice/report.php index 22dd6bed11..4923e4c57d 100644 --- a/mod/choice/report.php +++ b/mod/choice/report.php @@ -3,11 +3,10 @@ require_once("../../config.php"); require_once("lib.php"); - $id = required_param('id'); //moduleid - + $id = required_param('id', PARAM_INT); //moduleid $format = optional_param('format', CHOICE_PUBLISH_NAMES, PARAM_INT); $download = optional_param('download', '', PARAM_ALPHA); - $action = optional_param('action', ''); + $action = optional_param('action', '', PARAM_ALPHA); if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect"); diff --git a/mod/choice/view.php b/mod/choice/view.php index 9c52c8ec20..b9f06cf791 100644 --- a/mod/choice/view.php +++ b/mod/choice/view.php @@ -3,8 +3,9 @@ require_once("../../config.php"); require_once("lib.php"); - $id = required_param('id', PARAM_INT); // Course Module ID - $action = optional_param('action', ''); + $id = required_param('id', PARAM_INT); // Course Module ID + $action = optional_param('action', '', PARAM_ALPHA); + $attemptids = optional_param('attemptid', array(), PARAM_INT); // array of attempt ids for delete action if (! $cm = get_record("course_modules", "id", $id)) { error("Course Module ID was incorrect"); @@ -32,7 +33,6 @@ if (isteacher($course->id, $USER->id)) { if ($action == 'delete') { //some responses need to be deleted - $attemptids = isset($_POST['attemptid']) ? $_POST['attemptid'] : array(); //get array of repsonses to delete. choice_delete_responses($attemptids); //delete responses. redirect("view.php?id=$cm->id"); } -- 2.39.5