mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-10-24 12:26: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;
|
$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 the uniqueness of the username is to be ensured
|
||||||
if ($requireUniqueUsername) {
|
if ($requireUniqueUsername) {
|
||||||
// count the number of users who do already have that specified username
|
// count the number of users who do already have that specified username
|
||||||
|
|||||||
Reference in New Issue
Block a user