From d990357be93dbe50b22c32e5fe41de4fbfc85c46 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 8 Mar 2011 15:44:51 -0800 Subject: [PATCH] fix off-by-one error in poll results display --- plugins/Poll/Poll.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Poll/Poll.php b/plugins/Poll/Poll.php index 8d02f7de34..65aad4830e 100644 --- a/plugins/Poll/Poll.php +++ b/plugins/Poll/Poll.php @@ -166,7 +166,9 @@ class Poll extends Managed_DataObject $raw = array(); while ($pr->fetch()) { - $raw[$pr->selection] = $pr->votes; + // Votes list 1-based + // Array stores 0-based + $raw[$pr->selection - 1] = $pr->votes; } $counts = array();