Strip ZERO WIDTH SPACE in StringUtil::trim()
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Dec 2021 11:31:56 +0000 (12:31 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Dec 2021 11:32:20 +0000 (12:32 +0100)
wcfsetup/install/files/lib/util/StringUtil.class.php

index 7acc8a7ee28fb6b96212d27d641e57a309bf1351..d266e0d427d53301f501854f9006a5c69f72d934 100644 (file)
@@ -109,9 +109,9 @@ final class StringUtil
         // specification.
         // Do not merge the expressions, they are separated for
         // performance reasons.
-        $text = \preg_replace('/^[\p{Zs}\s\x{202E}]+/u', '', $text);
+        $text = \preg_replace('/^[\p{Zs}\s\x{202E}\x{200B}]+/u', '', $text);
 
-        return \preg_replace('/[\p{Zs}\s\x{202E}]+$/u', '', $text);
+        return \preg_replace('/[\p{Zs}\s\x{202E}\x{200B}]+$/u', '', $text);
     }
 
     /**