]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix off-by-one error in poll results display
authorBrion Vibber <brion@pobox.com>
Tue, 8 Mar 2011 23:44:51 +0000 (15:44 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 8 Mar 2011 23:44:51 +0000 (15:44 -0800)
plugins/Poll/Poll.php

index 8d02f7de34a10e6ad358b25084de7fb1983be5ce..65aad4830ee31abe8146d448873faef5072ecc18 100644 (file)
@@ -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();