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:
Lukas Fleischer 2012-07-06 11:47:02 +02:00
parent c1bb1df2b3
commit 8a5adf46ae

View file

@ -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);