1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-29 04:50:51 +02:00

[ticket/16004] Add check-in for Emojis in Username

PHPBB3-16004
This commit is contained in:
3D-I
2019-03-31 07:08:20 +02:00
parent e6ac4daf64
commit dc80ffdb40
2 changed files with 8 additions and 0 deletions

View File

@@ -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)) . "'";