From: Alexander Ebert Date: Mon, 5 Sep 2016 10:25:52 +0000 (+0200) Subject: Fixed \u200B crashing every party X-Git-Tag: 3.0.0_Beta_1~303 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6b7fa161ed4acfe36da0da7e33fb46f5bcd74f6a;p=GitHub%2FWoltLab%2FWCF.git Fixed \u200B crashing every party --- 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.