From d6b6c21d8369b02ddc8255027bfcc43a26e60cc8 Mon Sep 17 00:00:00 2001
From: tgloeggl <tgloeggl@uos.de>
Date: Wed, 22 Dec 2021 10:52:25 +0100
Subject: [PATCH] fixes #489

---
 lib/models/Courseware/BlockTypes/Text.php | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lib/models/Courseware/BlockTypes/Text.php b/lib/models/Courseware/BlockTypes/Text.php
index ce2a774af6a..c4fe67c68db 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
-- 
GitLab