1
0
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:
Marco
2017-02-20 20:48:03 +01:00
parent fb6f3d31b8
commit 784030139b

View File

@@ -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