From 0f7a290b6a8e4a52bffc16bd6e99a71994ff13ee Mon Sep 17 00:00:00 2001 From: dignajar Date: Mon, 13 Jul 2020 11:48:30 +0200 Subject: [PATCH] Store usernames in lowercases. #1225 --- bl-kernel/users.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bl-kernel/users.class.php b/bl-kernel/users.class.php index 1d9bd111..ede3eb1d 100644 --- a/bl-kernel/users.class.php +++ b/bl-kernel/users.class.php @@ -63,6 +63,7 @@ class Users extends dbJSON { { // The username is store as key and not as field $username = $args['username']; + $username = Text::lowercase($username); // The password is hashed, the password doesn't need to be sanitize in the next step $password = $args['password']; @@ -98,6 +99,7 @@ class Users extends dbJSON { { // The username is store as key and not as field $username = $args['username']; + $username = Text::lowercase($username); // Current database of the user $row = $this->db[$username]; @@ -133,6 +135,7 @@ class Users extends dbJSON { // Delete an user public function delete($username) { + $username = Text::lowercase($username); unset($this->db[$username]); return $this->save(); } @@ -159,7 +162,7 @@ class Users extends dbJSON { public function setRememberToken($username, $token) { - $args['username'] = $username; + $args['username'] = Text::lowercase($username); $args['tokenRemember'] = $token; return $this->set($args); }