mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-10-23 20:06:05 +02:00
Treat empty string or whitespace-only string as non-existent username
This commit is contained in:
@@ -711,6 +711,12 @@ class Auth {
|
||||
|
||||
$username = isset($username) ? trim($username) : null;
|
||||
|
||||
// if the supplied username is the empty string or has consisted of whitespace only
|
||||
if ($username === '') {
|
||||
// this actually means that there is no username
|
||||
$username = null;
|
||||
}
|
||||
|
||||
// if the uniqueness of the username is to be ensured
|
||||
if ($requireUniqueUsername) {
|
||||
// count the number of users who do already have that specified username
|
||||
|
Reference in New Issue
Block a user