Better check for bad resource name - Found by skodak SC#32

This commit is contained in:
moodler
2004-12-15 13:02:48 +00:00
parent 01988ca33f
commit a97e45be56
@@ -24,7 +24,11 @@ function display() {
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
if ($resource->reference) {
if (detect_munged_arguments($resource->reference, 0)) {
error("The filename contains illegal characters!");
}
$relativepath = "{$course->id}/{$resource->reference}";
} else {
$relativepath = "{$course->id}";