From 784030139baa39e3aea5c62368b072f55564e406 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 20 Feb 2017 20:48:03 +0100 Subject: [PATCH] Treat empty string or whitespace-only string as non-existent username --- src/Auth.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Auth.php b/src/Auth.php index c3bc8ef..efbe7a9 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -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