From 8a5adf46ae80d396245aa87d6e952d508b31a2db Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 6 Jul 2012 11:47:02 +0200 Subject: 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 --- web/lib/acctfuncs.inc.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/lib/acctfuncs.inc.php') diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index a46c9df..59f499e 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -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); -- cgit v1.2.3-70-g09d2