From df5d8b8c77f078366eec89ee9111b1634595d5eb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 8 Dec 2016 19:54:26 +0100 Subject: [PATCH] Updated regex The old regex was taken from `StringUtil::trim()` and has been replaced with the new version. --- .../system/html/input/node/HtmlInputNodeProcessor.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index dbd63c9775..d129187c88 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -277,7 +277,7 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor { if ($paragraph->firstChild && $paragraph->firstChild->nodeType === XML_TEXT_NODE) { $oldNode = $paragraph->firstChild; - $newNode = $paragraph->ownerDocument->createTextNode(preg_replace('/^(\s|'.chr(226).chr(128).chr(175).'|'.chr(194).chr(160).')+/', '', $oldNode->textContent)); + $newNode = $paragraph->ownerDocument->createTextNode(preg_replace('/^[\p{Zs}\s]+/u', '', $oldNode->textContent)); $paragraph->insertBefore($newNode, $oldNode); $paragraph->removeChild($oldNode); @@ -285,7 +285,7 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor { if ($paragraph->lastChild && $paragraph->lastChild->nodeType === XML_TEXT_NODE) { $oldNode = $paragraph->lastChild; - $newNode = $paragraph->ownerDocument->createTextNode(preg_replace('/(\s|'.chr(226).chr(128).chr(175).'|'.chr(194).chr(160).')+$/', '', $oldNode->textContent)); + $newNode = $paragraph->ownerDocument->createTextNode(preg_replace('/[\p{Zs}\s]+$/u', '', $oldNode->textContent)); $paragraph->insertBefore($newNode, $oldNode); $paragraph->removeChild($oldNode); -- 2.20.1