Simulate proper HTML to prevent issues
authorAlexander Ebert <ebert@woltlab.com>
Wed, 6 Jul 2016 10:11:23 +0000 (12:11 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 6 Jul 2016 10:11:23 +0000 (12:11 +0200)
wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php

index 4c473aa64be115367293f2c8bbb43c40cb79df74..fa254f03debf13d87bcaa44b3e77ab5181a4973f 100644 (file)
@@ -60,7 +60,7 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor {
                // We're also injecting a bogus meta tag that magically enables DOMDocument
                // to handle UTF-8 properly. This avoids encoding non-ASCII characters as it
                // would conflict with already existing entities when reverting them.
-               @$this->document->loadHTML('<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />' . $html);
+               @$this->document->loadHTML('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body>' . $html . '</body></html>');
                
                $this->nodeData = [];
        }