MDL-34549 libraries: Changing strictness of context::instance_by_id() when required
This commit is contained in:
@@ -104,7 +104,7 @@ class block_html extends block_base {
|
||||
function content_is_trusted() {
|
||||
global $SCRIPT;
|
||||
|
||||
if (!$context = context::instance_by_id($this->instance->parentcontextid)) {
|
||||
if (!$context = context::instance_by_id($this->instance->parentcontextid, IGNORE_MISSING)) {
|
||||
return false;
|
||||
}
|
||||
//find out if this block is on the profile page
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ function block_html_pluginfile($course, $birecord_or_cm, $context, $filearea, $a
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
if ($parentcontext = context::instance_by_id($birecord_or_cm->parentcontextid)) {
|
||||
if ($parentcontext = context::instance_by_id($birecord_or_cm->parentcontextid, IGNORE_MISSING)) {
|
||||
if ($parentcontext->contextlevel == CONTEXT_USER) {
|
||||
// force download on all personal pages including /my/
|
||||
//because we do not have reliable way to find out from where this is used
|
||||
|
||||
Reference in New Issue
Block a user