Tidy Message::parseAsBlock() by enabling tidy in MessageCache
[lhc/web/wiklou.git] / includes / cache / MessageCache.php
index 869f768..5dee0f6 100644 (file)
@@ -198,6 +198,7 @@ class MessageCache {
                                // either.
                                $po = ParserOptions::newFromAnon();
                                $po->setAllowUnsafeRawHtml( false );
+                               $po->setTidy( true );
                                return $po;
                        }
 
@@ -206,6 +207,8 @@ class MessageCache {
                        // from malicious sources. As a precaution, disable
                        // the <html> parser tag when parsing messages.
                        $this->mParserOptions->setAllowUnsafeRawHtml( false );
+                       // For the same reason, tidy the output!
+                       $this->mParserOptions->setTidy( true );
                }
 
                return $this->mParserOptions;