MDL-57386 blocklib: wrong variable in is_block_present

This isn't reachable code in core moodle, but themes/plugins could call is_block_present to trigger it.
This commit is contained in:
Damyon Wiese 2016-12-15 10:35:10 +08:00
parent 5ef81f2b0b
commit 08d7c0e1ca

View File

@ -246,7 +246,7 @@ class block_manager {
return false;
}
$undeletableblocks = self::get_undeletable_block_types();
$requiredbythemeblocks = self::get_required_by_theme_block_types();
foreach ($this->blockinstances as $region) {
foreach ($region as $instance) {
if (empty($instance->instance->blockname)) {
@ -254,7 +254,7 @@ class block_manager {
}
if ($instance->instance->blockname == $blockname) {
if ($instance->instance->requiredbytheme) {
if (!in_array($block->name, $undeletableblocks)) {
if (!in_array($blockname, $requiredbythemeblocks)) {
continue;
}
}