summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class2
-rwxr-xr-xtests/it.t5
2 files changed, 6 insertions, 1 deletions
diff --git a/it.class b/it.class
index 1382073..36bc903 100644
--- a/it.class
+++ b/it.class
@@ -341,7 +341,7 @@ static function convertregex($pattern, $p = null)
static function match($pattern, $string, $p = null)
{
if (!preg_match('/\\\\[wb]|[!\x80-\xff]|\[\[:/i', $pattern) && !$p)
- $r = preg_match('!' . $pattern . '!i', $string, $m); # fast path for simple patterns
+ $r = preg_match('!' . $pattern . '!i' . (ini_get('default_charset') == 'utf-8' ? 'u' : ''), $string, $m); # fast path for simple patterns
else
{
$flags = $p['offset_capture'] ? PREG_OFFSET_CAPTURE : 0;
diff --git a/tests/it.t b/tests/it.t
index c0efa2c..1a308ec 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -207,6 +207,11 @@ match(
utf8_encode('Müller'),
'\w matches umlaut in utf-8 mode'
);
+match(
+ 'M.ller', utf8_encode('Müller'),
+ utf8_encode('Müller'),
+ '. matches umlaut in utf-8 mode'
+);
ini_set('default_charset', $oldcharset);
is(