From: NetzwergX Date: Sat, 18 May 2013 12:05:30 +0000 (+0200) Subject: Added UTF-8 support for pattern strings in regular expressions X-Git-Tag: 2.0.0_Beta_1~153^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5f68d23653a9d935103a4c815fd2ccf497a15e22;p=GitHub%2FWoltLab%2FWCF.git Added UTF-8 support for pattern strings in regular expressions --- 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; } } +