From 6b7fa161ed4acfe36da0da7e33fb46f5bcd74f6a Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 5 Sep 2016 12:25:52 +0200 Subject: [PATCH] Fixed \u200B crashing every party --- .../lib/system/html/node/AbstractHtmlNodeProcessor.class.php | 3 +++ 1 file changed, 3 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 b2d70057ce..5c5cdaf5af 100644 --- a/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/node/AbstractHtmlNodeProcessor.class.php @@ -53,6 +53,9 @@ abstract class AbstractHtmlNodeProcessor implements IHtmlNodeProcessor { $this->document = new \DOMDocument('1.0', 'UTF-8'); $this->xpath = null; + // strip UTF-8 zero-width whitespace + $html = preg_replace('~\x{200B}~u', '', $html); + // Ignore all errors when loading the HTML string, because DOMDocument does not // provide a proper way to add custom HTML elements (even though explicitly allowed // in HTML5) and the input HTML has already been sanitized by HTMLPurifier. -- 2.20.1