diff options
author | msquare <msquare@notrademark.de> | 2017-07-28 20:11:09 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-07-28 20:11:09 +0200 |
commit | f82e5456d22af7e39a22a9a64e74072cf01e0a31 (patch) | |
tree | c024194bd11621e1956a659a0ec91ee7c747b40c /includes/pages/guest_login.php | |
parent | 69a1ee2bfefb43a802dea8cf0f833cbe0a00369c (diff) |
dried code by introducing selectOne for select queries with only one result line expected
Diffstat (limited to 'includes/pages/guest_login.php')
-rw-r--r-- | includes/pages/guest_login.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 106db33a..f8c52767 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -399,9 +399,8 @@ function guest_login() if ($request->has('submit')) { if ($request->has('nick') && strlen(User_validate_Nick($request->input('nick'))) > 0) { $nick = User_validate_Nick($request->input('nick')); - $login_user = DB::select('SELECT * FROM `User` WHERE `Nick`=?', [$nick]); - if (count($login_user) > 0) { - $login_user = $login_user[0]; + $login_user = DB::selectOne('SELECT * FROM `User` WHERE `Nick`=?', [$nick]); + if (!empty($login_user)) { if ($request->has('password')) { if (!verify_password($request->post('password'), $login_user['Passwort'], $login_user['UID'])) { $valid = false; |