Don't try to display docs files if they don't exist.
authormoodler <moodler>
Wed, 1 Jan 2003 12:03:15 +0000 (12:03 +0000)
committermoodler <moodler>
Wed, 1 Jan 2003 12:03:15 +0000 (12:03 +0000)
lib/moodlelib.php

index 3ca169be92c0989118ed89c1e129b868c16955da..1b700be04be57110fb8d93f6f923c4b980bde05c 100644 (file)
@@ -1006,6 +1006,10 @@ function document_file($file, $include=true) {
     if (!file_exists($info->filepath)) {
         $info->filepath = "$CFG->dirroot/lang/en/docs/$file";
         $info->urlpath  = "$CFG->wwwroot/lang/en/docs/$file";
+        if (!file_exists($info->filepath)) {
+            error("Error 404 - $file does not exist");
+            return NULL;
+        }
     }
 
     if ($include) {