From cb4287ea7070781e9020fea1fe8f6719c17bda0b Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 9 Mar 2004 06:28:31 +0000 Subject: [PATCH] Reverting previous fix, since it's now done across the board by file.php --- mod/resource/fetch.php | 50 +++++------------------------------------- mod/resource/view.php | 4 ---- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/mod/resource/fetch.php b/mod/resource/fetch.php index 9ce62b58c1..0dfd3e4f78 100644 --- a/mod/resource/fetch.php +++ b/mod/resource/fetch.php @@ -1,11 +1,11 @@ -results, FORMAT_HTML); - echo format_text($content->results, FORMAT_HTML); - - } else if ($file) { - - $pathinfo = urldecode($file); - - if (! $args = parse_slash_arguments($pathinfo)) { - error("No valid arguments supplied"); - } - - $numargs = count($args); - $courseid = (integer)$args[0]; - - if ($courseid != $course->id) { // Light security check - error("Course IDs don't match"); - } - - if ($course->category) { - require_login($courseid); - } - - $pathname = "$CFG->dataroot$pathinfo"; - $filename = $args[$numargs-1]; - - if (file_exists($pathname)) { - $lastmodified = filemtime($pathname); - - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $lastmodified) . " GMT"); - header("Pragma: "); - header("Content-disposition: inline; filename=$filename"); - header("Content-length: ".filesize($pathname)); - header("Content-type: text/html"); - - $content = implode('', file($pathname)); - echo format_text($content, FORMAT_HTML); - - } else { - error("Sorry, but the file you are looking for was not found ($pathname)", "course/view.php?id=$courseid"); - } - } ?> diff --git a/mod/resource/view.php b/mod/resource/view.php index ef1f834072..26eee6561c 100644 --- a/mod/resource/view.php +++ b/mod/resource/view.php @@ -165,10 +165,6 @@ } $fullurl = "$CFG->wwwroot$relativeurl"; - if ($CFG->resource_filterexternalpages and $resourcetype == "html") { - $fullurl = "$CFG->wwwroot/mod/resource/fetch.php?id=$cm->id&file=/$course->id/$resource->reference"; - } - /// Check whether this is supposed to be a popup, but was called directly -- 2.39.5