diff --git a/src/Utils/Strings.php b/src/Utils/Strings.php index 2a649ea7e..896bd2d83 100644 --- a/src/Utils/Strings.php +++ b/src/Utils/Strings.php @@ -21,7 +21,7 @@ class Strings { use Nette\StaticClass; - public const TrimCharacters = " \t\n\r\0\x0B\u{A0}"; + public const TrimCharacters = " \t\n\r\0\x0B\u{A0}\u{200B}"; /** @deprecated use Strings::TrimCharacters */ public const TRIM_CHARACTERS = self::TrimCharacters; diff --git a/tests/Utils/Strings.trim().phpt b/tests/Utils/Strings.trim().phpt index b271f9ca7..e7ff102b6 100644 --- a/tests/Utils/Strings.trim().phpt +++ b/tests/Utils/Strings.trim().phpt @@ -17,6 +17,7 @@ Assert::same('x', Strings::trim(" \t\n\r\x00\x0B\u{A0}x")); Assert::same('a b', Strings::trim(' a b ')); Assert::same(' a b ', Strings::trim(' a b ', '')); Assert::same('e', Strings::trim("\u{158}e-", "\u{158}-")); // Ře- +Assert::same('foo', Strings::trim("​foo")); // Contains \u{200B} - `ZWSPfoo` Assert::exception( fn() => Strings::trim("\xC2x\xA0"),