Skip to content
Snippets Groups Projects
Commit 0854ce63 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fix ForumEntry::removeQuotes() so that it won't return a doctype element as...

parent 68965bed
No related branches found
No related tags found
No related merge requests found
......@@ -146,14 +146,14 @@ class ForumEntry implements PrivacyObject
if (Studip\Markup::isHtml($description)) {
// remove all blockquote tags
$dom = new DOMDocument();
$dom->loadHtml($description);
$dom->loadHtml($description, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$nodes = iterator_to_array($dom->getElementsByTagName('blockquote'));
foreach ($nodes as $node) {
$node->parentNode->removeChild($node);
}
return str_replace(array('<html><body>','</body></html>') , '' , $dom->saveHTML());
return $dom->saveHTML();
} else {
$description = preg_replace('/\[quote(=.*)\].*\[\/quote\]/isU', '', $description);
$description = str_replace('[/quote]', '', $description);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment