From 581ea5013ae8164caed1f7e0603f9713be901f0d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 31 Mar 2016 15:07:22 +0800 Subject: [PATCH] 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. --- lib/blocklib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/blocklib.php b/lib/blocklib.php index 90cee6f62ed..9a7c9963d52 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -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); }