]> git.mjollnir.org Git - moodle.git/commitdiff
Added call to optional_param()
authorgustav_delius <gustav_delius>
Tue, 11 Apr 2006 20:42:31 +0000 (20:42 +0000)
committergustav_delius <gustav_delius>
Tue, 11 Apr 2006 20:42:31 +0000 (20:42 +0000)
question/question.php

index 5fbe26ced06d2d949e328c9d360fe284e2cf1ec0..73d7b7f835ffadb074c8998ed4364ae8056bc5f7 100644 (file)
@@ -30,6 +30,9 @@
 
     $qtype = optional_param('qtype', '', PARAM_FILE);
     $category = optional_param('category', 0, PARAM_INT);
+    
+    $delete = optional_param('delete',  0, PARAM_INT);
+    $confirm = optional_param('confirm',  0, PARAM_INT);
 
     // rqp questions set the type to rqp_nn where nn is the rqp_type id
     if (substr($qtype, 0, 4) == 'rqp_') {
 
     print_header_simple("$streditingquestion", "", $strediting);
 
-    if (isset($_REQUEST['delete'])) {
-        $delete = required_param('delete', PARAM_INT);
-        if (isset($confirm) and confirm_sesskey()) {
+    if ($delete) {
+        if ($confirm and confirm_sesskey()) {
             if ($confirm == md5($delete)) {
                 if (record_exists('quiz_question_instances', 'question', $question->id) or
                     record_exists('question_states', 'originalquestion', $question->id)) {