From 88495aa8d296a218623d1bf9dfcb915f77bf8c00 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Thu, 22 Mar 2007 22:02:14 +0000 Subject: [PATCH] Followup to MDL-8994 - validate the category id we got from the form. Merged from MOODLE_18_STABLE. --- question/type/questiontype.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/question/type/questiontype.php b/question/type/questiontype.php index fa481e93a1..dfa507e5b4 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -150,6 +150,9 @@ class default_questiontype { // question types. // First, save the basic question itself + if (!record_exists('question_categories', 'id', $form->category)) { + print_error('categorydoesnotexist', 'question'); + } $question->category = $form->category; $question->name = trim($form->name); $question->questiontext = trim($form->questiontext); -- 2.39.5