diff --git a/lib.php b/lib.php index 0e73edf..a2a494d 100644 --- a/lib.php +++ b/lib.php @@ -800,7 +800,7 @@ function format_vsf_pluginfile($course, $cm, $context, $filearea, $args, $forced // Make sure the filearea is one of those used by the plugin. if ($filearea !== 'modicon' && strpos($filearea, 'modicon_') !== 0) { - return false; + send_file_not_found(); } // Leave this line out if you set the itemid to null in make_pluginfile_url (set $itemid to 0 instead). @@ -819,7 +819,7 @@ function format_vsf_pluginfile($course, $cm, $context, $filearea, $args, $forced $fs = get_file_storage(); $file = $fs->get_file($context->id, 'format_vsf', $filearea, $itemid, $filepath, $filename); if (!$file) { - return false; // The file does not exist. + send_file_not_found(); // The file does not exist. } send_stored_file($file, null, 0, $forcedownload, $options);