Skip to content

Commit

Permalink
MDL-32147 SCORM improve performance of 404s for files inside SCORM pa…
Browse files Browse the repository at this point in the history
…ckages.
  • Loading branch information
danmarsden committed Mar 22, 2012
1 parent a2b30aa commit 6ceef54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mod/scorm/lib.php
Expand Up @@ -923,6 +923,10 @@ function scorm_pluginfile($course, $cm, $context, $filearea, $args, $forcedownlo

$fs = get_file_storage();
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->is_directory()) {
if ($filearea === 'content') { //return file not found straight away to improve performance.
header('HTTP/1.0 404 not found');
die;
}
return false;
}

Expand Down

0 comments on commit 6ceef54

Please sign in to comment.