From d0ff90ed4f0935239c4e13604743900c489e2d9a Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Tue, 2 Nov 2010 01:05:43 +0000 Subject: [PATCH] MDL-25000 backup - prevent calling get_mapping() with empty ids. Yay, 25000! --- .../backup/moodle2/restore_qtype_multichoice_plugin.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php b/question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php index 728541e4429..7ea7899a7b8 100644 --- a/question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php +++ b/question/type/multichoice/backup/moodle2/restore_qtype_multichoice_plugin.class.php @@ -102,13 +102,13 @@ class restore_qtype_multichoice_plugin extends restore_qtype_plugin { } // Map order foreach (explode(',', $lists[0]) as $id) { - if ($newid = $this->get_mappingid('question_answer', $id)) { + if (!empty($id) && $newid = $this->get_mappingid('question_answer', $id)) { $orderarr[] = $newid; } } // Map responses foreach (explode(',', $lists[1]) as $id) { - if ($newid = $this->get_mappingid('question_answer', $id)) { + if (!empty($id) && $newid = $this->get_mappingid('question_answer', $id)) { $responsesarr[] = $newid; } }