Don't try to display docs files if they don't exist.

This commit is contained in:
moodler 2003-01-01 12:03:15 +00:00
parent fdb57a7473
commit 0c106cd3ab

View File

@ -1006,6 +1006,10 @@ function document_file($file, $include=true) {
if (!file_exists($info->filepath)) { if (!file_exists($info->filepath)) {
$info->filepath = "$CFG->dirroot/lang/en/docs/$file"; $info->filepath = "$CFG->dirroot/lang/en/docs/$file";
$info->urlpath = "$CFG->wwwroot/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) { if ($include) {