From b8dc0a880b7c085bb06d5fadfc88a738d9ea5ffc Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 16 Dec 2019 09:01:09 +0000 Subject: [PATCH] if login fails with a space, try with underscore --- core/user.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/user.php b/core/user.php index e01b64ac..e74c4e96 100644 --- a/core/user.php +++ b/core/user.php @@ -116,6 +116,9 @@ class User public static function by_name_and_pass(string $name, string $pass): ?User { $my_user = User::by_name($name); + if (!$my_user && strpos($name, "_") !== false) { + $my_user = User::by_name(str_replace(" ", "_", $name)); + } if ($my_user) { if ($my_user->passhash == md5(strtolower($name) . $pass)) { log_info("core-user", "Migrating from md5 to bcrypt for ".html_escape($name));