From ef1889484b61acea74cd9839c6987d91b153107b Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 22 Mar 2012 20:05:59 +1300 Subject: [PATCH] MDL-32147 SCORM improve performance of 404s for files inside SCORM packages. --- mod/scorm/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index e239096375e..ed2a9cdd299 100644 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -921,6 +921,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; }