[aur-dev] [PATCH] pkgfuncs.inc.php: Fix undefined variable notice

Lukas Fleischer archlinux at cryptocrack.de
Sun Sep 30 17:36:49 EDT 2012


Fixes a undefined variable notice in getvotes() that popped up when a
package without any votes was requested.

Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
---
 web/lib/pkgfuncs.inc.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 3589dbb..6a7cbb5 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -993,6 +993,7 @@ function getvotes($pkgid, $dbh=NULL) {
 		return;
 	}
 
+	$votes = array();
 	while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
 		$votes[] = $row;
 	}
-- 
1.7.12.1



More information about the aur-dev mailing list