Navigation Menu

Skip to content

Commit

Permalink
MDL-37797 HTML block: add contextid to block_positions query and make…
Browse files Browse the repository at this point in the history
… it more unique.
  • Loading branch information
thepurpleblob authored and Rossiani Wijaya committed Feb 5, 2013
1 parent a8e927e commit 3bcf80e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filelib.php
Expand Up @@ -4277,7 +4277,7 @@ function file_pluginfile($relativepath, $forcedownload, $preview = null) {
send_file_not_found(); 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 // 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)) { if (($bprecord && !$bprecord->visible) || !has_capability('moodle/block:view', $context)) {
send_file_not_found(); send_file_not_found();
Expand Down

0 comments on commit 3bcf80e

Please sign in to comment.