Hi Alexander,

At Adam's prompting, I've taken a look at this bug.  In your test case, the
trigger seems to be this part of the check:

  \x80-\xF7

We've noticed that splitting this into \x80-\xA0 and \xA1-\xF7 fixes the
problem.

\xA0, \xA1 is a boundary between character classes: \x80-\xA0 are control
characters, and \xA1-x\F7 are printable characters (latin1 punctuation and
letters).  I'm not sure if it's a feature for mb_ereg() to complain about
ranges that span character classes, but I'm inclined to think that you don't
actually want control characters to be in your usernames anyway.

Even with this change, though, the regexp doesn't seem to work so well with
actual multibyte UTF8 chars in the string being compared.

-- 
Steve Langasek
postmodern programmer

Attachment: signature.asc
Description: Digital signature

Reply via email to