mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
[ticket/16004] Add check-in for Emojis in Username
PHPBB3-16004
This commit is contained in:
parent
e6ac4daf64
commit
dc80ffdb40
@ -1760,6 +1760,13 @@ function validate_username($username, $allowed_username = false)
|
||||
return 'USERNAME_TAKEN';
|
||||
}
|
||||
|
||||
// Check for out-of-bounds characters that are currently
|
||||
// not supported by utf8_bin in MySQL
|
||||
if (preg_match('/[\x{10000}-\x{10FFFF}]/u', $username))
|
||||
{
|
||||
return 'INVALID_EMOJIS_USERNAME';
|
||||
}
|
||||
|
||||
$sql = 'SELECT group_name
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($username)) . "'";
|
||||
|
@ -272,6 +272,7 @@ $lang = array_merge($lang, array(
|
||||
'IMPORTANT_NEWS' => 'Important announcements',
|
||||
'INVALID_USER_BIRTHDAY' => 'The entered birthday is not a valid date.',
|
||||
'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.',
|
||||
'INVALID_EMOJIS_USERNAME' => 'The username contains forbidden characters (Emoji).',
|
||||
'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.',
|
||||
'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out.',
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user