mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/security/254] Disallow whitespace characters that might be invisible
SECURITY-254
This commit is contained in:
@@ -1752,7 +1752,8 @@ function validate_username($username, $allowed_username = false, $allow_all_name
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ... fast checks first.
|
// ... fast checks first.
|
||||||
if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username))
|
if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username)
|
||||||
|
|| preg_match('/[\x{180E}\x{2005}-\x{200D}\x{202F}\x{205F}\x{2060}\x{FEFF}]/u', $username))
|
||||||
{
|
{
|
||||||
return 'INVALID_CHARS';
|
return 'INVALID_CHARS';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user