From a2bfc128cd22e42cca148be3fbc4efb9e78765fd Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 1 Aug 2016 17:07:05 +0200 Subject: [PATCH] Removed doctype and fixed entities for text/plain Fixes #2069 --- .../lib/system/html/node/AbstractHtmlNodeProcessor.class.php | 1 + .../system/html/output/node/HtmlOutputNodeProcessor.class.php | 1 + 2 files changed, 2 insertions(+) diff --git a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php index 57a7f1466d..94884bd4c9 100644 --- a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php @@ -72,6 +72,7 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor { $html = $this->document->saveHTML($this->document->getElementsByTagName('body')->item(0)); // remove nuisance added by PHP + $html = preg_replace('~^]+>\n~', '', $html); $html = preg_replace('~^~', '', $html); $html = preg_replace('~$~', '', $html); diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php index 175ea2884f..b34e21f657 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeProcessor.class.php @@ -100,6 +100,7 @@ class HtmlOutputNodeProcessor extends AbstractHtmlNodeProcessor { if ($this->outputType === 'text/plain') { $html = StringUtil::trim($html); + $html = StringUtil::decodeHTML($html); } return $html; -- 2.20.1