diff --git a/modules/poll.module b/modules/poll.module index bdf7a2ea12350ca13a5d1060897f0a4bc5b10253..79a1a9704b8a51b53514987d3e8b32410f01558c 100644 --- a/modules/poll.module +++ b/modules/poll.module @@ -293,7 +293,7 @@ function poll_view_results(&$node, $main, $block, $links) { if ($node->choice) { foreach ($node->choice as $key => $value) { if ($value != "") { - $width = round($node->chvotes[$key] * 100 / $votestotal); + $width = round($node->chvotes[$key] * 100 / max($votestotal, 1)); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); $output .= "<div class=\"text\">". filter($value) ."</div>"; $output .= "<div class=\"bar\">"; diff --git a/modules/poll/poll.module b/modules/poll/poll.module index bdf7a2ea12350ca13a5d1060897f0a4bc5b10253..79a1a9704b8a51b53514987d3e8b32410f01558c 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -293,7 +293,7 @@ function poll_view_results(&$node, $main, $block, $links) { if ($node->choice) { foreach ($node->choice as $key => $value) { if ($value != "") { - $width = round($node->chvotes[$key] * 100 / $votestotal); + $width = round($node->chvotes[$key] * 100 / max($votestotal, 1)); $percentage = round($node->chvotes[$key] * 100 / max($votestotal, 1)); $output .= "<div class=\"text\">". filter($value) ."</div>"; $output .= "<div class=\"bar\">";