mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
test return value from db_query before assuming it is valid
make the sql query form consistent in usage by cleaning up instances where db_query's result was not inspected before attempting to fetch row data from the handle Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
d38f3460e5
commit
0898f1447a
7 changed files with 135 additions and 68 deletions
|
@ -491,8 +491,12 @@ function get_salt($user_id)
|
|||
{
|
||||
$dbh = db_connect();
|
||||
$salt_q = "SELECT Salt FROM Users WHERE ID = " . $user_id;
|
||||
$salt_result = mysql_fetch_row(db_query($salt_q, $dbh));
|
||||
return $salt_result[0];
|
||||
$result = db_query($salt_q, $dbh);
|
||||
if ($result) {
|
||||
$salt_row = mysql_fetch_row($result);
|
||||
return $salt_row[0];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function save_salt($user_id, $passwd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue