diff --git a/components/ILIAS/COPage/Editor/Server/class.Server.php b/components/ILIAS/COPage/Editor/Server/class.Server.php index 63f3f4f64272..4d27af1bf26b 100755 --- a/components/ILIAS/COPage/Editor/Server/class.Server.php +++ b/components/ILIAS/COPage/Editor/Server/class.Server.php @@ -73,6 +73,10 @@ public function reply(): void $response = $action_handler->handle($query); } else { //sleep(5); + // Argument #2 ($body) must be of type array, null given + if (!is_array($body)) { + $body = array(); + } $action_handler = $this->getActionHandlerForCommand($query, $body); $response = $action_handler->handle($query, $body); } @@ -115,8 +119,10 @@ protected function getActionHandlerForCommand( array $body ): CommandActionHandler { $handler = null; - - switch ($body["component"]) { + //Undefined array key "component + //switch ($body["component"]) { + $component = isset($body['component']) ? $body['component'] : null; + switch ($component) { case "Paragraph": $handler = new ParagraphCommandActionHandler($this->page_gui); break; @@ -157,7 +163,8 @@ protected function getActionHandlerForCommand( } if ($handler === null) { - throw new Exception("Unknown component " . ((string) $body["component"])); + // throw new Exception("Unknown component " . ((string) $body["component"])); + throw new Exception("Unknown component " . ((string) $component)) } return $handler; }