NOBUG: better handling of {module}_pluginfile() return values

{module}_pluginfile() should either send the file or
send_file_not_found() or print an error and terminate or whatever, it
should never return to the caller
This commit is contained in:
mudrd8mz
2009-09-07 14:45:20 +00:00
parent e640790eb6
commit 520199ea02
+4 -2
View File
@@ -281,9 +281,11 @@ if ($context->contextlevel == CONTEXT_SYSTEM) {
$filefunction = $modname.'_pluginfile';
if (function_exists($filefunction)) {
if ($filefunction($course, $cminfo, $context, $filearea, $args, $forcedownload) !== false) {
die;
// if the function exists, it must send the file and terminate. Whatever it returns leads to "not found"
$filefunction($course, $cminfo, $context, $filearea, $args, $forcedownload);
}
send_file_not_found();
}
} else if ($context->contextlevel == CONTEXT_BLOCK) {