MDL-52035 core_block: avoid PHP error when there is no region

This occurs when sharing a quiz via the LTI provider when it
adds a 'fake block' for quiz navigation. There may be other
occurrences.
This commit is contained in:
Mark Nelson
2016-04-26 12:08:31 +08:00
parent 466a1713a0
commit 581ea5013a
+3
View File
@@ -271,6 +271,9 @@ class block_manager {
* @return boolean true if this region exists on this page.
*/
public function is_known_region($region) {
if (empty($region)) {
return false;
}
return array_key_exists($region, $this->regions);
}