diff --git modules/user/user.module modules/user/user.module index e8b1fe2..48dc5dc 100644 --- modules/user/user.module +++ modules/user/user.module @@ -390,7 +390,12 @@ function user_validate_name($name) { if (strpos($name, ' ') !== FALSE) { return t('The username cannot contain multiple spaces in a row.'); } - if (preg_match('/[^\x{80}-\x{F7} a-z0-9@_.\'-]/i', $name)) { + if (preg_match('/[^\x80-\xBF'. // Second, third or fourth byte of a multibyte sequence. + '\xC2-\xDF'. // Start of a 2-byte sequence. + '\xE0-\xEF'. // Start of a 3-byte sequence. + '\xF0-\xF7'. // Start of a 4-byte sequence. + ' a-z0-9@_.\'-]/i', // Desired characters from the single byte range. + $name)) { return t('The username contains an illegal character.'); } if (preg_match('/[\x{80}-\x{A0}'. // Non-printable ISO-8859-1 + NBSP