Permalink
Browse files

MDL-37797 HTML block: add contextid to block_positions query and make…

… it more unique.
  • Loading branch information...
1 parent 5e3412d commit 3c21fdc9ce4732e801659c3ab37d6d92c148f769 @thepurpleblob thepurpleblob committed with rwijaya Feb 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/filelib.php
View
@@ -4236,7 +4236,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
send_file_not_found();
}
- $bprecord = $DB->get_record('block_positions', array('blockinstanceid' => $context->instanceid), 'visible');
+ $bprecord = $DB->get_record('block_positions', array('contextid' => $context->id, 'blockinstanceid' => $context->instanceid));
// 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();

0 comments on commit 3c21fdc

Please sign in to comment.