Skip to content

Commit

Permalink
MDL-49366 questions: avoid PHP notices from bad pluginfile URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Mar 5, 2015
1 parent b90f98d commit 9c75f8d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/questionlib.php
Expand Up @@ -1833,6 +1833,9 @@ function question_pluginfile($course, $context, $component, $filearea, $args, $f

$module = $DB->get_field('question_usages', 'component',
array('id' => $qubaid));
if (!$module) {
send_file_not_found();
}

if ($module === 'core_question_preview') {
require_once($CFG->dirroot . '/question/previewlib.php');
Expand Down

0 comments on commit 9c75f8d

Please sign in to comment.