Fix login failed when username contains @ (#1894)
* Fix login failed when username contains @ * Update var/Widget/User.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -153,9 +153,16 @@ class User extends Users
|
||||
/** 开始验证用户 **/
|
||||
$user = $this->db->fetchRow($this->db->select()
|
||||
->from('table.users')
|
||||
->where((strpos($name, '@') ? 'mail' : 'name') . ' = ?', $name)
|
||||
->where('name = ?', $name)
|
||||
->limit(1));
|
||||
|
||||
if (empty($user) && strpos($name, '@') !== false) {
|
||||
$user = $this->db->fetchRow($this->db->select()
|
||||
->from('table.users')
|
||||
->where('mail = ?', $name)
|
||||
->limit(1));
|
||||
}
|
||||
|
||||
if (empty($user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user