diff --git a/lib/models/Courseware/BlockTypes/Text.php b/lib/models/Courseware/BlockTypes/Text.php index ce2a774af6a68d3a6c794e0d70a1d358aaf52b71..c4fe67c68db239f9a3c8ce1d82265201686aaf53 100755 --- a/lib/models/Courseware/BlockTypes/Text.php +++ b/lib/models/Courseware/BlockTypes/Text.php @@ -35,6 +35,22 @@ class Text extends BlockType return ['text' => '']; } + public function getPayload() + { + $payload = parent::getPayload(); + + $payload['text'] = \Studip\Markup::purifyHtml(\Studip\Markup::markAsHtml($payload['text'])); + + return $payload; + } + + public function setPayload($payload): void + { + $payload['text'] = \Studip\Markup::purifyHtml(\Studip\Markup::markAsHtml($payload['text'])); + + parent::setPayload($payload); + } + public static function getJsonSchema(): Schema { $schemaFile = __DIR__.'/Text.json'; @@ -42,7 +58,7 @@ class Text extends BlockType return Schema::fromJsonString(file_get_contents($schemaFile)); } - /** + /** * get all files related to this block. * * @return \FileRef[] list of file references realted to this block