mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/16004] Move the check-in to a more appropriated place
PHPBB3-16004
This commit is contained in:
parent
dc80ffdb40
commit
5bd2c067c5
1 changed files with 8 additions and 7 deletions
|
@ -1709,6 +1709,14 @@ function validate_username($username, $allowed_username = false)
|
|||
return false;
|
||||
}
|
||||
|
||||
// The very first check is 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';
|
||||
}
|
||||
|
||||
// ... fast checks first.
|
||||
if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username))
|
||||
{
|
||||
|
@ -1760,13 +1768,6 @@ 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)) . "'";
|
||||
|
|
Loading…
Add table
Reference in a new issue