Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-mdl-32155-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
commit 605b5391847825540249d6644d6b187284258a76 2 parents b51ac4e + c58c05a
@danpoltawski danpoltawski authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/filelib.php
View
6 lib/filelib.php
@@ -3898,6 +3898,12 @@ function file_pluginfile($relativepath, $forcedownload) {
// somebody tries to gain illegal access, cm type must match the component!
send_file_not_found();
}
+
+ $bprecord = $DB->get_record('block_positions', array('blockinstanceid' => $context->instanceid), 'visible');
+ // User can't access file, if block is hidden or doesn't have block:view capability
+ if (($bprecord && !$bprecord->visible) || !has_capability('moodle/block:view', $context)) {
+ send_file_not_found();
+ }
} else {
$birecord = null;
}
Please sign in to comment.
Something went wrong with that request. Please try again.