From 5f68d23653a9d935103a4c815fd2ccf497a15e22 Mon Sep 17 00:00:00 2001 From: NetzwergX Date: Sat, 18 May 2013 14:05:30 +0200 Subject: [PATCH] Added UTF-8 support for pattern strings in regular expressions --- wcfsetup/install/files/lib/system/Regex.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/lib/system/Regex.class.php b/wcfsetup/install/files/lib/system/Regex.class.php index 56e0b9acad..922a04b2ad 100644 --- a/wcfsetup/install/files/lib/system/Regex.class.php +++ b/wcfsetup/install/files/lib/system/Regex.class.php @@ -68,6 +68,12 @@ final class Regex { */ const MULTILINE = 64; + /** + * indicates that pattern string is treated as UTF-8. + * @var integer + */ + const UTF_8 = 128; + /** * indicates that no flags are set * @var integer @@ -145,6 +151,7 @@ final class Regex { if ($modifier & self::IGNORE_WHITESPACE) $this->regex .= 'x'; if ($modifier & self::DOT_ALL) $this->regex .= 's'; if ($modifier & self::MULTILINE) $this->regex .= 'm'; + if ($modifier & self::UTF_8) $this->regex .= 'u'; } /** @@ -285,3 +292,4 @@ final class Regex { return $this->regex; } } + -- 2.20.1