mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing SQL error in AuthComponent::identify() when username is empty (Ticket #2402)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4847 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
b0307904ae
commit
4e8a803e81
1 changed files with 8 additions and 2 deletions
|
@ -641,12 +641,18 @@ class AuthComponent extends Object {
|
|||
}
|
||||
|
||||
if (is_array($user) && (isset($user[$this->fields['username']]) || isset($user[$this->userModel . '.' . $this->fields['username']]))) {
|
||||
if (isset($user[$this->fields['username']])) {
|
||||
if (isset($user[$this->fields['username']]) && !empty($user[$this->fields['username']])) {
|
||||
if (trim($user[$this->fields['username']]) == '=') {
|
||||
return false;
|
||||
}
|
||||
$find = array(
|
||||
$this->fields['username'] => $user[$this->fields['username']],
|
||||
$this->fields['password'] => $user[$this->fields['password']]
|
||||
);
|
||||
} else {
|
||||
} elseif (isset($user[$this->userModel . '.' . $this->fields['username']]) && !empty($user[$this->userModel . '.' . $this->fields['username']])) {
|
||||
if (trim($user[$this->userModel . '.' . $this->fields['username']]) == '=') {
|
||||
return false;
|
||||
}
|
||||
$find = array(
|
||||
$this->fields['username'] => $user[$this->userModel . '.' . $this->fields['username']],
|
||||
$this->fields['password'] => $user[$this->userModel . '.' . $this->fields['password']]
|
||||
|
|
Loading…
Reference in a new issue