mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 09:43:03 +00:00
acctfuncs.inc.php: Fix "Undefined variable" notices
Initialize the "$details" and "$whovoted" variables with an empty array/string to suppress a "Undefined variable" notice if the votes/voters list is empty. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
parent
c1bb1df2b3
commit
8a5adf46ae
1 changed files with 4 additions and 0 deletions
|
@ -751,6 +751,7 @@ function current_proposal_list($order, $dbh=NULL) {
|
|||
$q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
|
||||
$result = db_query($q, $dbh);
|
||||
|
||||
$details = array();
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$details[] = $row;
|
||||
}
|
||||
|
@ -766,6 +767,7 @@ function past_proposal_list($order, $lim, $dbh=NULL) {
|
|||
$q = "SELECT * FROM TU_VoteInfo WHERE End < " . time() . " ORDER BY Submitted " . $order . $lim;
|
||||
$result = db_query($q, $dbh);
|
||||
|
||||
$details = array();
|
||||
while ($row = mysql_fetch_assoc($result)) {
|
||||
$details[] = $row;
|
||||
}
|
||||
|
@ -804,6 +806,8 @@ function voter_list($voteid, $dbh=NULL) {
|
|||
$dbh = db_connect();
|
||||
}
|
||||
|
||||
$whovoted = '';
|
||||
|
||||
$q = "SELECT tv.UserID,U.Username ";
|
||||
$q.= "FROM TU_Votes tv, Users U ";
|
||||
$q.= "WHERE tv.VoteID = " . intval($voteid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue