Skip to content

Commit

Permalink
Tell the server that the file was not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Aug 30, 2024
1 parent 37879f0 commit e8036b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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);
Expand Down

0 comments on commit e8036b9

Please sign in to comment.