File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ public function recordLoginAttempt(
5656 ?string $ userAgent = null ,
5757 $ userId = null
5858 ): void {
59+ $ this ->disableDBDebug ();
60+
5961 $ return = $ this ->insert ([
6062 'ip_address ' => $ ipAddress ,
6163 'user_agent ' => $ userAgent ,
Original file line number Diff line number Diff line change @@ -169,18 +169,16 @@ public function findByCredentials(array $credentials): ?User
169169 $ email = $ credentials ['email ' ] ?? null ;
170170 unset($ credentials ['email ' ]);
171171
172- $ prefix = $ this ->db ->DBPrefix ;
173-
174172 // any of the credentials used should be case-insensitive
175173 foreach ($ credentials as $ key => $ value ) {
176- $ this ->where (" LOWER( { $ prefix } users. {$ key }) " , strtolower ($ value ));
174+ $ this ->where (' LOWER( ' . $ this -> db -> protectIdentifiers ( " users. {$ key }" ) . ' ) ' , strtolower ($ value ));
177175 }
178176
179177 if (! empty ($ email )) {
180178 $ data = $ this ->select ('users.*, auth_identities.secret as email, auth_identities.secret2 as password_hash ' )
181179 ->join ('auth_identities ' , 'auth_identities.user_id = users.id ' )
182180 ->where ('auth_identities.type ' , Session::ID_TYPE_EMAIL_PASSWORD )
183- ->where (" LOWER( { $ prefix } auth_identities.secret) " , strtolower ($ email ))
181+ ->where (' LOWER( ' . $ this -> db -> protectIdentifiers ( ' auth_identities.secret ' ) . ' ) ' , strtolower ($ email ))
184182 ->asArray ()
185183 ->first ();
186184
You can’t perform that action at this time.
0 commit comments