From 0cd482e54d875298a29939187ed270413e910c73 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 25 Sep 2006 08:53:10 +0000 Subject: [PATCH] fix for MDL-6599 - problem with hiding of resource when $CFG->preventaccesstohiddenfiles enabled --- file.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/file.php b/file.php index 92232ebf7b..dd9b161a7f 100644 --- a/file.php +++ b/file.php @@ -107,9 +107,12 @@ // warning: it may break backwards compatibility if ((!empty($CFG->preventaccesstohiddenfiles)) and (count($args) >= 2) + and (!(strtolower($args[1]) == 'moddata' and strtolower($args[2]) != 'resource')) // do not block files from other modules! and (!has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_COURSE, $course->id)))) { - $reference = ltrim($relativepath, "/{$args[0]}/"); + $rargs = $args; + array_shift($rargs); + $reference = implode('/', $rargs); $sql = "SELECT COUNT(r.id) " . "FROM {$CFG->prefix}resource r, " . -- 2.39.5