From 062b0f25db63709be54dd6e2f527bbe44a30728b Mon Sep 17 00:00:00 2001 From: Matthias Grief Date: Mon, 6 Jan 2025 17:04:46 +0100 Subject: [PATCH] fehlerhaftes Erstellen von geschachtelten p-Tags behoben --- webseite/topicEditor.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webseite/topicEditor.php b/webseite/topicEditor.php index a3b7655..040092e 100644 --- a/webseite/topicEditor.php +++ b/webseite/topicEditor.php @@ -189,6 +189,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { // extension=mbstring in php.ini muss aktiviert sein! $article = mb_convert_encoding($dom->saveHTML(), 'UTF-8', 'HTML-ENTITIES'); + $article = preg_replace("/^[ \r\n\t]*

/", "

", $article); + $article = preg_replace("#

[ \r\n\t]*$#", "

", $article); if (isset($allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']])) { $newTopic = $allSubjects[$_POST['subjectId']]->getTopics()[$_POST['id']];