From 0c106cd3abf4a23751f5c9e0dfb35b234aef9ee3 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 1 Jan 2003 12:03:15 +0000 Subject: [PATCH] Don't try to display docs files if they don't exist. --- lib/moodlelib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 3ca169be92c..1b700be04be 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -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) {